How can I solve "Invalid object handle" error when trying to open a .fig?

4 ビュー (過去 30 日間)
Franck Dernoncourt
Franck Dernoncourt 2013 年 7 月 22 日
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;"
Here is the figure I'm trying to open: http://francky.me/misc/my_figure.fig
Thanks, F
  2 件のコメント
David Sanchez
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.
Franck Dernoncourt
Franck Dernoncourt 2013 年 7 月 22 日
編集済み: Franck Dernoncourt 2013 年 7 月 22 日
Thanks, I cannot open the figure, but I don't think the issue is specific to the file like some damage as the issue occurs for all my figures in the script, and I did several runs. I added a few more details on how the figure was saved: maybe I cannot use saveas(gcf,'my_figure.fig', 'fig') when launching through matlab -nodesktop ?

サインインしてコメントする。

回答 (2 件)

David Sanchez
David Sanchez 2013 年 7 月 22 日
Try doing it with a figure handle:
h = figure;
plot(1:4,5:8)
saveas(h,'my_fig.fig')

Jan
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).

カテゴリ

Help Center および File ExchangeInteractive Control and Callbacks についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by