How do i input this on MATLAB
11 ビュー (過去 30 日間)
古いコメントを表示
How can i input x^3+px+q=0 on MATLAB and find x in terms of p & q?
1 件のコメント
Image Analyst
2022 年 7 月 13 日
Original question in case he edits this one away:
How can i input x^3+px+q=0 on MATLAB and find x in terms of p & q?
回答 (1 件)
John D'Errico
2022 年 7 月 5 日
Assuming that p and q are real numbers, do you understand there will ALWAYS be three solutions to the problem, and that for many values of p and q, exactly two of those solutions will be complex valued?
cubicroots = @(p,q) roots([1 0 p q]);
format long
cubicroots(2,3)
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Polynomials についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!