Index exceeds number of array elements/Issue with Symbolic Variable
Ältere Kommentare anzeigen
A = [0 1;-2 -0.2];
[T,Gamma] = eig(A);
syms t
e_Tinv_A_T = [exp(Gamma(1,1)*t) 0 ; ...
0 exp(Gamma(2,2)*t)];
I get the following error message when attempting to find e_Tinv_A_T:
An unexpected error has occurred:
Index exceeds the number of array elements. Index must not exceed 4.
I'm not entirely sure why I am unable to multiply the "gamma" values above by the symbolic variable t. Are they not the same dimension?
Antworten (1)
A = [0 1;-2 -0.2];
[T,Gamma] = eig(A);
syms t
e_Tinv_A_T = [exp(Gamma(1,1)*t) 0 ; ...
0 exp(Gamma(2,2)*t)]
It shows no error. Clar all your variables and try running the code.
Kategorien
Mehr zu Matrix Indexing finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
