Index exceeds number of array elements/Issue with Symbolic Variable

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)]
e_Tinv_A_T = 
It shows no error. Clar all your variables and try running the code.

Products

Release

R2021b

Asked:

on 4 Nov 2021

Answered:

on 4 Nov 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!