Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- eq = 'x^4 - 7*x^3 + 3*x^2 - 5*x + 9 = 0';
- s = solve(eq);
- disp('The first root is: '), disp(s(1));
- disp('The second root is: '), disp(s(2));
- disp('The third root is: '), disp(s(3));
- disp('The fourth root is: '), disp(s(4));
- % converting the roots to double type
- disp('Numeric value of first root'), disp(double(s(1)));
- disp('Numeric value of second root'), disp(double(s(2)));
- disp('Numeric value of third root'), disp(double(s(3)));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement