How to get the positive root of the cubic a*x^3+3*b*x^2+3*c*x+d=0
2 views (last 30 days)
Show older comments
How to get the positive root of the cubic a*x^3+3*b*x^2+3*c*x+d=0 where a=1,c=b+2, d=-3 and b=.1:.1:2.
If rr is the root, find rr/(rr+1) for each b.
0 Comments
Accepted Answer
Kye Taylor
on 17 Apr 2013
Edited: Kye Taylor
on 17 Apr 2013
You can try
b = .1:.1:2;
a = 1;
c = b+2;
d = -3;
posR = zeros(1,length(b));
for i = 1:length(b)
r = roots([a,3*b(i),3*c(i),d]);
posR(i) = r(r>0); % only one real root for the values you specified
posR(i) = posR(i)/(posR(i)+1);
end
0 Comments
More Answers (2)
rania saidi
on 14 Mar 2021
Résolution équation a*x^3+b*x^2+c*x+d=0 a=6 ; b=1 ; c=-4; d=1 dans matlab
0 Comments
See Also
Categories
Find more on Interpolation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!