I have a question about the Quadratic formula on Matlab. How can I use of IF statement for this formula and how can I find third and fourth output. For example, for a=6 b=5 c=-4.

3 views (last 30 days)
I have a question about the Quadratic formula on Matlab.
How can I use of IF statement for this formula and how can I find third and fourth output. For example, for a=6 b=5 c=-4.

Answers (1)

darova
darova on 3 May 2020
Use this formula
if D == 0
x = -b/2/a;
else
x = [-b+sqrt(D) -b-sqrt(D)]/2/a;
end

Categories

Find more on Quadratic Programming and Cone Programming in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!