Undefined function or variable 'figure1_SizeChangedFcn'.
8 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
采纳的回答
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
2018-12-18
2 个评论
Cris LaPierre
2018-12-24
编辑:Cris LaPierre
2018-12-24
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 Center 和 File Exchange 中查找有关 Migrate GUIDE Apps 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!