How do i input this on MATLAB
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
How can i input x^3+px+q=0 on MATLAB and find x in terms of p & q?
1 comentario
Image Analyst
el 13 de Jul. de 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?
Respuestas (1)
John D'Errico
el 5 de Jul. de 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 comentarios
Ver también
Categorías
Más información sobre Polynomials en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!