Solving a Cubic Equation
3 ビュー (過去 30 日間)
古いコメントを表示
I am new to Matlab and I can't work out how to solve this cubic equation.
(Q/Qw)^3-(Q/Qw)-(1/F^3)=0.
I have Qw and F both as 1x108 matrices and I am trying to solve this equation for Q.
I would like to be able to see the answers in Q as numbers as to extract them so Q/Qw against f could be plotted.
Any help would be much appreciated.
0 件のコメント
採用された回答
Nathaniel
2012 年 11 月 5 日
The built-in function roots is what you're looking for.
4 件のコメント
Nathaniel
2012 年 11 月 12 日
So hopefully by now, you have read the documentation and learned the proper syntax.
In the interest of not leaving this thread hanging, this is the syntax for your equation. If you have 108 of them, then you'll need to put it in a loop.
Q = roots([1/Qw 0 -1/Qw -1/F^3]);
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!