write a matlab command to find th roots of: ax^2+bx+c=0
11 ビュー (過去 30 日間)
古いコメントを表示
write a MATLAB commads to find the roots of : ax^2+bx+c=0 , where a,b and c are constants?
0 件のコメント
採用された回答
jahanzaib ahmad
2019 年 1 月 13 日
編集済み: madhan ravi
2019 年 1 月 15 日
a=1;
b=2;
c=3;
x1 = -b +(sqrt((b^2)-(4ac)/(2a))x;
x2=-b-(sqrt((b^2)-(4ac)/(2a));
disp(x1);
disp(x2);
1 件のコメント
jahanzaib ahmad
2019 年 1 月 14 日
編集済み: madhan ravi
2019 年 1 月 15 日
a=1;
b=2;
c=3;
x1 = -b +(sqrt((b.^2)-(4.*a.*c)))/(2.*a);
x2=-b -(sqrt((b.^2)-(4.*a.*c)))/(2.*a);
disp(x1);
disp(x2);
その他の回答 (2 件)
madhan ravi
2019 年 1 月 14 日
編集済み: madhan ravi
2019 年 1 月 14 日
help roots
doc roots
help poly2sym
doc poly2sym
0 件のコメント
参考
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!