Error at open 163 again (trying to open a figure)

3 ビュー (過去 30 日間)
Boris
Boris 2012 年 6 月 28 日
コメント済み: Le Thi Khuyen 2016 年 5 月 23 日
Hey there!
I get a weird error. Before, I plotted a graph and saved the figure and afterwards, I could open it without any problems.
modeprob = figure;
save('mode_probabilities.fig','modeprob');
Since some time now, when I try to open these files, I get Error using ==> open at 163 on PC and Error using ==> open at 162 on Mac
I still can open the old files that I saved this way, but not any new files that I saved this way. If I save the figure by clicking 'save' through the GUI it works fine.
I am aware of this thread and I do not have anything new in the path. True, I did download some external toolboxes, but I removed them and I even restored the 'default' path. Now when I use which -all message
I get the same thing that the "best answer" guy got. I tried moving those four to the end but didn't help. Any ideas?
Thanks!

採用された回答

Sean de Wolski
Sean de Wolski 2012 年 6 月 28 日
First, you're overwriting figure, don't know if that has anythign to with this, but it certainly isn't a good idea.
Second, I don't get why this should work, modeprob is the handle to the figure right? If so, then you're saving a handle to the figure that will no longer exist.
Third, I recommend using hgsave for this type of thing.
  4 件のコメント
Sean de Wolski
Sean de Wolski 2012 年 6 月 29 日
編集済み: Sean de Wolski 2012 年 6 月 29 日
Glad to hear!
Sounds like your computer isn't going to get its desired weekend getaway!
Boris
Boris 2012 年 7 月 2 日
Nope, it even had to work overnight! :)

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

その他の回答 (1 件)

Riemanns world
Riemanns world 2013 年 7 月 19 日
Thanks for pointing to hgsave. I was able to open a stubborn figure using hgload. Don't know if that would have worked in this situation.
I had a figure that wouldn't open and returned an error using using open (line 163). I tried to open it using the right click option "Open in GUIDE" and got both a series of command line errors (pasted below) and a dialog box of errors.
I was able to open the figure using hgload, and discovered that the figure somehow saved with two legends. I deleted one and can now open the file normally.
java.lang.ClassCastException: [D cannot be cast to [Ljava.lang.String;
at com.mathworks.toolbox.matlab.guide.LayoutEditor.completed(LayoutEditor.java:2218)
at com.mathworks.toolbox.matlab.guide.LayoutEditor$ReadFigureCompleted.completed(LayoutEditor.java:3049)
at com.mathworks.toolbox.matlab.guide.utils.LayoutWorker.runOnMatlabThread(LayoutWorker.java:55)
at com.mathworks.jmi.MatlabWorker$2.run(MatlabWorker.java:79)
at com.mathworks.jmi.MatlabWorker.start(MatlabWorker.java:248)
at com.mathworks.toolbox.matlab.guide.utils.LayoutWorker.start(LayoutWorker.java:70)
at com.mathworks.toolbox.matlab.guide.utils.LayoutWorker.fevalConsoleOutput(LayoutWorker.java:41)
at com.mathworks.toolbox.matlab.guide.LayoutLooper.readFigure(LayoutLooper.java:712)
at com.mathworks.toolbox.matlab.guide.LayoutEditor.openLayoutEditor(LayoutEditor.java:2015)
at com.mathworks.toolbox.matlab.guide.LayoutEditor.openLayoutEditor(LayoutEditor.java:1978)
  1 件のコメント
Le Thi Khuyen
Le Thi Khuyen 2016 年 5 月 23 日
I've tried to open a figure by using hgload, but in the command Window, it appears
Attempt to reference field of non-structure array.
Error in union (line 8) if g1.directed ~= g2.directed
Error in hgloadStructDbl>figload_reset (line 360) axlist = union(axlist,allChil);
Error in hgloadStructDbl (line 141) figload_reset(hFigures(i));
Error in C:\Program Files\MATLAB\R2012b\toolbox\matlab\graphics\hgload.p>hgload (line 68)
Could you tell me how can I do to troubleshoot this, please!

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

カテゴリ

Help Center および File ExchangeCreating, 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