I wrote this into matlab but it doesn't work, can someone explain why?
function [x1,x2] = QuadraticEquation (a,b,c)d=b^2-4*a*c;if d>=0disp ('two roots exist')x1=(-b-sqrt(d))/2*ax2=(-b+sqrt(d))/2*aplot(x1,0,'rx',x2,0,'rx')hold onx=-10:10y=a*x.^2+b*x+cplot(x,y)hold offelsedisp ('no real roots’)end
Best Answer