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

Solve the quadratic equation ax^2+bx+c=0. However, some of the normal functions and symbols are not allowed.

x=[ -b +/- sqrt ( b^2 - 4ac ) ] / ( 2a )

Unallowed functions and symbols:

roots mtimes cross prod cumprod times mldivide mrdivide dot numstr int2str dec2bin * / \ - ^ '

Derivative of Aurelien's Cody 813 Multiply 2 numbers

Also related to Cody 833 Side of a Triangle

Test suite "disallowed function usage check" courtesy of Aurelien Queffurust.

Example :


a= 1; b= 1; c=1


 x(1)= -0.5+0.866i; x(2)= -0.5-0.866i

Solution Stats

32.0% Correct | 68.0% Incorrect
Last solution submitted on Feb 10, 2017

Problem Comments


Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!