Reputation: 3021
I want to construct a time-dependent matrix A
Given
%t = [1,2,3];
A11 = [1,2,3]; %This is time-dependence of A(1,1)
A12 = [2,3,4]; %This is time-dependence of A(1,2)
A21 = [1,1,1]; %This is time-dependence of A(2,1)
A22 = [2,2,2]; %This is time-dependence of A(2,2)
such that
at t = 1
,
A = [1 2;1 2];
at t = 2
A = [2 3;1 2];
at t = 3
A = [3 4;1 2];
In general the four lists are much longer. How can I construct a list of matrix A
like that so that I know what A
is at each timestep for eigenvalues calculation.
After I do that, I want to find the eigenvectors at each timestep. For example,
[V D] = eig(A)
Upvotes: 1
Views: 41
Reputation: 45752
Sounds like you just want a 3D matrix, try
A = cat(3, [1, 2; 1, 2], [2, 3; 1, 2], [3, 4; 1, 2])
Or if you need to build it out of your A11
, A12
, etc... lists then how about
permute(cat(3, [A11;A21], [A12;A22]), [1,3,2])
Upvotes: 3