필터 지우기
필터 지우기

Matlab throws errors even though the script has not been touched

조회 수: 7 (최근 30일)
Philip  Spratt
Philip Spratt 2013년 6월 2일
I keep having a problem where my script, which is normally fine, decides not to work and throws errors. See below:
??? Error using ==> plus Matrix dimensions must agree.
Error in ==> pls at 421 model.reg = model.reg([1:ny]+(ny*(ncomp-1)),:)';
Error in ==> plsda at 225 model = pls(varargin{:});
Error in ==> PRS_VIEW_PLSDA_LOADINGS_v4ps>DoPLSDA_Callback at 479 MODEL = plsda(AXtic,Call,SetLVsOUT,OPTS);
Error in ==> gui_mainfcn at 96 feval(varargin{:});
Error in ==> PRS_VIEW_PLSDA_LOADINGS_v4ps at 44 gui_mainfcn(gui_State, varargin{:});
Error in ==> guidemfile>@(hObject,eventdata)PRS_VIEW_PLSDA_LOADINGS_v4ps('DoPLSDA_Callback',hObject,eventdata,guidata(hObject))
??? Error while evaluating uicontrol Callback
It resolved itself once without me doing anything, but has now happened again for some unknown reason. Previous version of the script I'm adapting also throw the same errors, even though they have not been changed at all.
Is there a potential issue with Matlab and variables stored in the memory maybe? Or something to do with confusion of functions being used.
Any ideas how to resolve this and prevent it from reoccurring?
  댓글 수: 1
Walter Roberson
Walter Roberson 2013년 6월 2일
At the MATLAB command line give the command
dbstop if error
and run the program. When it stops, examine ny and ncomp: I suspect that you will find that one of them is not a scalar. You could then trace back in the code to figure out why the value is not a scalar.
My suspicion is that you might be running the program on data that is a dimension higher than is expected, such as if you were trying to load 3 dimensional data where 2 dimensional data was expected. It is not uncommon for people to run into that kind of situation if they load in an RGB image where a program expects grayscale.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Graphics Object Programming에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by