Advertisement
Guest User

Untitled

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