Cody

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

Solution 114478

Submitted on 18 Jul 2012 by Grzegorz Knor
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 = Column 1 -0.500000000000000 + 0.866025403784439i Column 2 -0.500000000000000 - 0.866025403784439i ans = Column 1 -0.500000000000000 + 0.866025403784438i Column 2 -0.500000000000000 - 0.866025403784438i xq = Column 1 -0.500000000000000 + 0.866025403784438i Column 2 -0.500000000000000 - 0.866025403784438i ```
```xe = -0.267949192431123 -3.732050807568877 ans = -3.732050807568877 -0.267949192431123 xq = -3.732050807568877 -0.267949192431123 ```
```a = 1.760945615012275 xe = -0.286012800251771 -1.985494034428139 ans = -1.985494034428139 -0.286012800251771 xq = -1.985494034428139 -0.286012800251771 ```