Matlab - array of matrices
matlab
Solution
Use cell array's:
A = cell(N, 1);
A{1} = [ 1 0; 1 1 ];
A{2} = [ 0 1; 1 1 ];
Problem
I have two matrices A1 and A2, for example A1 = [1 0; 1 1]; and A2 = [0 1; 1 1]; Now I don't want to have them called A1 and A2 since I will have An matrices. So I wanted something like A(1) = [1 0; 1 1]; A(2) = [0 1; 1 1]; .. A(n) = [...]; But Matlab does not allow me to do this. I know one can use A(:,:,1) = [ ... ] but this is ugly and makes me type :,:, all the time... so I want to know if there is a different solution. I tried A.1 but structs field names need to be strings.