well, I am new to matlab programming and I have been battling on the indexing issues. I am currently working on image processing which so far drive me crazy. anyways, lets jump to the questions. I have the following code
perm=randperm(size(X,2));
CX=X(:,perm(1:nclus));
I tried to run the code but it triggers an error saying " Index exceeds the matrix dimensions. To my humble knowledge I think it is because the (:,perm(1:nclus))
is higher than the matrix dimensions. I would like to know how can i solve this problem.
Note that X: is the input points in the columns nclus: number of clusters.
I highly appreciate if you guys clarify to me the error cause and the possible solution for it.
Thank you
Sami