quadratic

quadratic - else if (b^2)-4*a*c == 0 disp('Repeated...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
function y = quadratic(a, b, c) x1 = (-b + sqrt((b^2)-4*a*c))/(2*a); x2 = (-b - sqrt((b^2)-4*a*c))/(2*a); if (b^2)-4*a*c < 0 disp('Sorry, Solutions are imaginary numbers.');
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: else if (b^2)-4*a*c == 0 disp('Repeated solutions are:'); disp(x1); else disp('Two solutions are:'); disp(x1); disp(x2); end end end...
View Full Document

Ask a homework question - tutors are online