How to get the positive root of the cubic a*x^3+3*b*x^2+3*c*x+d=0

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.

 採用された回答

Kye Taylor
Kye Taylor 2013 年 4 月 17 日
編集済み: Kye Taylor 2013 年 4 月 17 日

0 投票

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

その他の回答 (2 件)

rania saidi
rania saidi 2021 年 3 月 14 日

0 投票

Résolution équation ax3+bx2+cx+d=0 MATLAB
rania saidi
rania saidi 2021 年 3 月 14 日

0 投票

Résolution équation a*x^3+b*x^2+c*x+d=0 a=6 ; b=1 ; c=-4; d=1 dans matlab

カテゴリ

ヘルプ センター および File ExchangeVerification, Validation, and Test についてさらに検索

タグ

質問済み:

2013 年 4 月 17 日

回答済み:

2021 年 3 月 14 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by