Equation behind solution by using function roots
Ältere Kommentare anzeigen
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.
Akzeptierte Antwort
Weitere Antworten (1)
Walter Roberson
am 11 Jul. 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.)
Kategorien
Mehr zu Symbolic Math Toolbox finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!