Index exceeds number of array elements/Issue with Symbolic Variable
Show older comments
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?
Answers (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.
Categories
Find more on Matrix Indexing 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!