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

8 views (last 30 days)
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

Accepted Answer

Cris LaPierre
Cris LaPierre on 24 Dec 2018
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.

More Answers (1)

Cris LaPierre
Cris LaPierre on 18 Dec 2018
This sounds a lot like this question. Is the issue the same?
  2 Comments
Cris LaPierre
Cris LaPierre on 24 Dec 2018
Edited: Cris LaPierre on 24 Dec 2018
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.

Sign in to comment.

Categories

Find more on Migrate GUIDE Apps in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!