Let's say we have matrix A 50 by 50. and we have matrix B=[10 14 17 20 25] how can I put the rows of A(B(i)) into a cell. So if S is a cell S{1}=A(10,:), S{2}=A(14,:) … S{5}=A(25,:) this is just an example the numbers are made up. I tried this which didnt work. Many thanks.
n=numel(A);for i=1:n for jj=1:n S{jj}=(A(:,B(i))); endend
Best Answer