Equation behind solution by using function roots
Afficher commentaires plus anciens
Here is a minimum working example of my code:
f = [1 0 3 2];
V = roots(f);
It gives me the roots:
0.298035818991661 + 1.80733949445202i
0.298035818991661 - 1.80733949445202i
-0.596071637983321 + 0.00000000000000i
Here is the general solution to this equation:

How can I find out that matlab uses which of these equations for all of the three solutions?
In short: I want to find out not only the solution but also the equation used by Matlab to reach that solution. I know, I could manually input these values in the general solution and find the answer. But that will be cumbersome for many such equations. So I will require a compact solution.
Réponse acceptée
Plus de réponses (1)
Walter Roberson
le 11 Juil 2016
Please see http://www.mathworks.com/help/matlab/ref/roots.html#buo5imt-5 which describes the algorithm. It usually works numerically, not by equation. However, you can use
syms x1 x2 x3 x4
roots([x1 x2 x3 x4])
to see the generalized equation (which might not be used in some circumstances that would result in degeneracies.)
Catégories
En savoir plus sur Symbolic Math Toolbox dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!