MATLAB: I am executing this piece of code and getting the error” X=X(:,1:2:512); Index exceeds matrix dimensions.” help me to solve it.


close all; clear all; load woman; X=imread('lena256.bmp'); X=double(X); X=X(:,1:2:512);

Best Answer

  • run this into your script/command window:
    what is the size of X ? Does it have three dimensions ? Are you trying to select an index for an array location that does not exist?
    Did you understand the answer to your previous questions about array dimensions ?: