How do i input this on MATLAB
8 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
How can i input x^3+px+q=0 on MATLAB and find x in terms of p & q?
1 commentaire
Image Analyst
le 13 Juil 2022
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?
Réponses (1)
John D'Errico
le 5 Juil 2022
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 commentaires
Voir également
Catégories
En savoir plus sur Polynomials dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!