roots
2 次查看(过去 30 天)
显示 更早的评论
how to find a roots of a cubic equation in matlab?
0 个评论
回答(1 个)
Andrei Bobrov
2012-2-25
eg
use roots
%polynomial x^3-6*x^2-50*x-4
p = [1 -6 -50 -4]
out = roots(p)
use solve and Symbolic Math Toolbox
syms x
out2 = solve(x^3-6*x^2-50*x-4)
vpa(out2,6)
on Nasir comment
out = zeros(3,...);
for j1 = 1:....
B = ...
A = ...
out(:,j1) = roots([1, B-1, A-3*B^2, A*B-B^2-B^3]);
end
5 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Calculus 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!