"eig" in Simulink Matlab Function returns complex value.
Show older comments
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??
Accepted Answer
More Answers (0)
Categories
Find more on Scopes and Data Logging in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!