How can I solve "Invalid object handle" error when trying to open a .fig?
1 次查看(过去 30 天)
显示 更早的评论
When I try to open a figure using open('my_figure.fig'), I have this error message:

What are some likely issues?
The figure was saved using
saveas(gcf,'my_figure.fig', 'fig')
in a Matlab script that was run from the Linux shell:
matlab -nodesktop -r "run my_script; exit;"
Thanks, F
2 个评论
David Sanchez
2013-7-22
Can you open the figure somehow? I downloaded it and could not open it, which could mean the file is damaged.
回答(2 个)
David Sanchez
2013-7-22
Try doing it with a figure handle:
h = figure;
plot(1:4,5:8)
saveas(h,'my_fig.fig')
0 个评论
Jan
2013-7-22
You need to call the M-file to open a GUI, while opening a GUI just by opening the FIG file creates such errors, because the OpeningFcn or CreateFcn did not run (as far as I know, but I'm not using GUIDE for exactly such reasons).
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Interactive Control and Callbacks 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!