Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
What is Index exceeds matrix dimensions.error?
조회 수: 1 (최근 30일)
이전 댓글 표시
Sir I am facing this error. I cannot understan what it really means.
Error in singha>VALIDATE_Callback (line 506) s2 = std2(cimg(:,:,2));
Error in gui_mainfcn (line 96) feval(varargin{:});
Error in singha (line 42) gui_mainfcn(gui_State, varargin{:});
Error in @(hObject,eventdata)singha('VALIDATE_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating uicontrol Callback
댓글 수: 1
답변 (1개)
Adam
2015년 4월 23일
편집: Adam
2015년 4월 23일
Arrays/matrices have a dimension which you can check by
size( myArray );
Indexing into an array using an index greater than the size in the specified dimension leads to this error.
e.g. if you have a 3*3 array, myArray , both the following will yield this error:
myArray(3,4); % 4 exceeds the 2nd dimension size
myArray(2,2,3); % 3 exceeds the 3rd dimension size as there is no 3rd dimension
From this you should be able to see what is going wrong in your own code by debugging and since this is something fundamental to learn in Matlab it is better for your learning that you locate it rather than someone point out the error.
댓글 수: 3
Adam
2015년 4월 27일
You have already discovered the cause of the error yourself. Finding a solution for it is down to you working out what your matrices should be and what size they should be rather than something that can just be fixed by Matlab knowledge alone.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!