I'm quite new in Matlab and I would be more than grateful if you can help me with the following issue.
I have a .mat file v7.3 which has 26 matrices with increasing number i.e. Mw1, Mw2, Mw3.....Mw26
I want to load only the first column from each matrix separately to do some calculations and then go to the next one using for loop.
I know that there is the option of using matfile and then load the column that I want i.e.:
firstColB = example.B(:,1); (matlab documentation)
but I don't know how to do it in a loop...
For example:
First I have a .mat file with 26 matrices of 5000x4.
Then I want to load only the first column of matrixn (n=26)
Then do the following
ao=0;
a=[2,4,6,8,10,12,14,16,18,20]; %segments of the tube in cm
for j=1:10;
temp11=find(firstColumn>ao & firstColumn<=a(j)); %firstColumn of the *n*matrix
temp1=firstColumn(temp11,:);
eval(sprintf('A%d = temp1', j));
ao=a(j);
end
My problem:
This loop will generate 10 new matrices of A1, A2, A3......A10 without indicating that correspond to the first matrix (i.e.Mw1). It should be like A11, A12, A13...A110.
...when I finished with this loop I want automatically to go to the next matrix, and repeat the same but then the A matrices should be like A21, A22, A23....A210 since these new matrices correspond to the second matrix etc.
I hope it makes sence of what I'm trying to do!