"Error using quadroot (line 2). Not enough input arguments" why does it give me this error message? here is my code:
function [x] = quadroot(a,b,c) if a==0 %special cases
if b ~= 0 %single root
x1 = -c/b; else %trivial solution
disp('Trivial solution.') end else %quadratic equatioon
d = b^2 - 4*a*c; if d>=0 x1 = (-b + sqrt(d))/(2*a); x2 = (-b - sqrt(d))/(2*a); else x1 = -b/(2*a); i1 = sqrt(abs(d))/(2*a); x2 = x1; end end
Best Answer