Cody

# Problem 834. Solve Quadratic : No * - or key functions permitted

Solution 264586

Submitted on 20 Jun 2013 by andrea84
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
%% % Courtesy of Aurelien Queffurust filetext = fileread('quadratic.m'); assert(isempty(strfind(filetext, '*')),'sign * forbidden') assert(isempty(strfind(filetext, 'mtimes')),'mtimes forbidden') assert(isempty(strfind(filetext, 'cross')),'cross forbidden') assert(isempty(strfind(filetext, 'prod')),'prod forbidden') assert(isempty(strfind(filetext, 'cumprod'))) assert(isempty(strfind(filetext, 'times'))) assert(isempty(strfind(filetext, 'mldivide'))) assert(isempty(strfind(filetext, 'mrdivide'))) assert(isempty(strfind(filetext, '/')),'/ forbidden') assert(isempty(strfind(filetext, '\'))) assert(isempty(strfind(filetext, '-'))) assert(isempty(strfind(filetext, '^')),'^ forbidden') assert(isempty(strfind(filetext, 'dot'))) assert(isempty(strfind(filetext, '''')),'string forbidden') assert(isempty(strfind(filetext, 'num2str'))) assert(isempty(strfind(filetext, 'int2str'))) assert(isempty(strfind(filetext, 'dec2bin'))) assert(isempty(strfind(filetext, 'roots')))

``` ```

2   Pass
``` xe = -0.5000 + 0.8660i -0.5000 - 0.8660i ans = -0.5000 + 0.8660i -0.5000 - 0.8660i xq = -0.5000 + 0.8660i -0.5000 - 0.8660i ```
``` xe = -0.2679 -3.7321 ans = -0.2679 + 0.0000i -3.7321 + 0.0000i xq = -0.2679 + 0.0000i -3.7321 + 0.0000i ```
``` a = 1.8054 xe = -0.2872 -1.9284 ans = -0.2872 + 0.0000i -1.9284 + 0.0000i xq = -0.2872 + 0.0000i -1.9284 + 0.0000i ```