Undefined function or variable 'figure1_S​izeChanged​Fcn'.

조회 수: 11 (최근 30일)
Daniel Fonsêca
Daniel Fonsêca 2018년 12월 13일
댓글: Daniel Fonsêca 2019년 1월 7일
I tried resize my app using the Tools --> Gui Options --> Resize behavior --> Other (Use SizeChangedFCN). But, I changed my opinion and I decided to build my app without the resize. After I choose no resize my app, it started to show when my program run. Now, my program is this option Tools --> Gui Options --> Resize behavior --> Non-resizable
All error:
Undefined function or variable 'figure1_SizeChangedFcn'.
Error in gui_mainfcn (line 95)
feval(varargin{:});
Error in EDUFIS1 (line 42)
gui_mainfcn(gui_State, varargin{:});
Error in
matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)EDUFIS1('figure1_SizeChangedFcn',hObject,eventdata,guidata(hObject))
Error using matlab.hg.internal.openfigLegacy (line 117)
Error while evaluating Figure SizeChangedFcn

채택된 답변

Cris LaPierre
Cris LaPierre 2018년 12월 24일
I followed your steps and can recreate the problem. The issue is related, but there is a different way to fixing it, as you really don't want the callback function anymore. The resize callback gets added as the SizeChangedFcn in the property inspector. So even after changing the gui resize option and deleting the function from your code, there is still a handle to the resize callback function listed in the properties of the figure window.
To fix it, rt click on the figure and select "Property Inspector"
Scroll down until you see the SizeChangedFcn property. On the right you will see an anonymous function handle that looks something like this:
Delete everything to the right of SizeChangedFcn.
Close the property inspector and save the Figure file.
Run your code to verify the error has gone away.

추가 답변 (1개)

Cris LaPierre
Cris LaPierre 2018년 12월 18일
This sounds a lot like this question. Is the issue the same?
  댓글 수: 2
Cris LaPierre
Cris LaPierre 2018년 12월 24일
편집: Cris LaPierre 2018년 12월 24일
Sorry - Linked to the wrong post. I meant to link to this one.
There, the callback is added to the properties of the button, so deleting the button deletes all it's properties, fixing the issue (the other option is to readd the code for the callback).
Deleting the figure is not really an option, so we instead need to edit the properties.

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

카테고리

Help CenterFile Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by