"eig" in Simulink Matlab Function returns complex value.
Afficher commentaires plus anciens
Hi. I am using simulink - matlab function. When I use it, an odd phenomenon happens.
here's my matlab function code
function y = fcn(A)
[V, ~] = eig(A);
y = V(:,4);
when I input matrix "A" as
A = [ -551.2750 -68.3967 -39.4810 1.1936;
-68.3967 197.8717 440.4691 0.9514;
-39.4810 440.4691 -204.0590 -2.1449;
1.1936 0.9514 -2.1449 557.4624]
y returns complex value in the simulink - matlab function.
-> y = [ 0.0015 + 0.0000i
-0.0041 + 0.0000i
-0.0053 + 0.0000i
1.0000 + 0.0000i]
But y returns real value in the .m file. (I used same "A" matrix)
-> y = [ 0.0015
-0.0041
-0.0053
1.0000]
why??
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Scopes and Data Logging dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!