I currently have a Matrix (Mcell) made up of 27390 submatrices which are either 2 by 2. or 1 by 1.
For example:
Mcell{1,1} = 8 -0.5 24 -0.6
I need to extract the value 8 (In the 1,1 position) from each of the sub-matrices and have it in a list it doesn't matter if it's a column or a row.
So far I can do this using this code:
A=[Mcell{1,1}(1,1) Mcell{2,1}(1,1) Mcell{3,1}(1,1) Mcell{4,1}(1,1) Mcell{5,1}(1,1)];
But that only works for the first 5, and I need to replicate it for all of them.
I have tried doing the following:
for i= 1:27390; A=[Mcell{i,1}(1,1)];end
But it just gave me the 1,1 value for Mcell{27390,1}. Rather than a list of values.
I also need to do this for the {2,1} position of each submatrix but I'm hopeful I can use the same code for both.
It would also need to preserve the length (27390), so where there wasn't a submatrix value for the (2,1) position a '0' needs to go in it's place.
Many thanks
Best Answer