I have a matrix of IC 2008×1 that has values from 1 to 16 (some in between number might be missing) and I want to create a matrix that each column has the rows of the original matrix that correspond to each value 1 to 16 eg original matrix 4; 1; 3; 2; 5; 6; 4; new matrix [2] [4] [3] [1;7] [5] [6]
I try to do this like this for j=1:B
k=find(IC==j); F(:,j)=k;
end where B is 16 but it says that Subscripted assignment dimension mismatch. Do you know an alternative that works regaldless of this mismatch?
Best Answer