I have read the FAQ to extract parts of an existing matrix
to new matrices only by selection of rows but had no success.
I wish to do the following:
Let M=
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
10 10
and the following parameters to create a loop:
for k=1:3;
l=(k+1);
m=(2*k)+3;
mk=M(l:m,1:end);
end;
I wished by doing that above to get the following results
for k=1
m1=
2 2
3 3
4 4
5 5
for k=2
m2=
3 3
4 4
5 5
6 6
7 7
for k=3
m3=
4 4
5 5
6 6
7 7
8 8
9 9
and so on. Instead, as result I obtained only:
mk=
4 4
5 5
6 6
7 7
8 8
9 9
It is only the matrix for the last value of k and the index 3 is not
appearing instead of k for mk.
Hopefully someone knows how to fix this problem
Thank you
Emerson
Best Answer