I am trying to write a function that gives me the roots of a quadratic function (ax^2+bc+c), but my vurrent function only gives me a single answer and I cant figure out why.
function [y1,y2] = QuadFor(x1,x2,x3)
y1 = -x2 + [sqrt(x2^2 – 4*x1*x3)] / (2*x1);
y2 = -x2 – [sqrt(x2^2 – 4*x1*x3)] / (2*x1);
end;
Best Answer