Hi all,
I have two matrices, and I am trying to remove rows in one for numbers which are not part of the other. Below is my attempt:
trials;for x = 1:256 if ~ismember(trials,x); rows2remove=[x]; imagesAll(rows2remove,:)=[]; end % imagesCut =
end
But it is not working and I get the following error message (I guess because it keeps deleting rows?):
Matrix index is out of range for deletion.Error in samplecode (line 21) imagesAll(rows2remove,:)=[];
Please could anyone help me with my code? Many thanks
Best Answer