Modification to GUIDE corrupts FIG-file
7 ビュー (過去 30 日間)
古いコメントを表示
Hello,
I used GUIDE for creating a GUI and I have been using the program for 2 months and it always worked fine.
Now suddenly I get the following error message when trying to open the figure in GUIDE or trying to run the program:
Unable to read MAT-file
mydirectory/myfig.fig
File may be corrupt.
Error in graphics.internal.figfile.FigFile/read (line 25)
hgDataVars = load(filename, '-mat', '-regexp', '^hg[SO]');
Error in graphics.internal.figfile.FigFile (line 98)
obj.read(file);
Error in matlabroot\toolbox\matlab\graphics\hgload.p>hgload (line 59)
Error in openfig (line 72)
[fig, savedvisible] = hgload(filename, struct('Visible','off'));
Error in gui_mainfcn>local_openfig (line 286)
gui_hFigure = openfig(name, singleton, visible);
Error in gui_mainfcn (line 159)
gui_hFigure = local_openfig(gui_State.gui_Name, gui_SingletonOpt, gui_Visible);
Error in myfig (line 42)
gui_mainfcn(gui_State, varargin{:});
All I changed today was adding a 'save' button in the toolbar with "tools->toolbar editor". I can't even try if that caused the problem by undoing it because, as I mentioned above, I can't open the figure in GUIDE.
It would be very nice if anyone could help me.
I am using MATLAB R2013a on Windows 8.
Thank you!
採用された回答
Image Analyst
2016 年 4 月 19 日
Like Walter said, restore from your back up. (You do have one right? If not, you've learned a good lesson.) Better yet, time to upgrade that 3 year old version to the latest version. Or else build a new GUI from scratch and just copy and paste callback function code/contents to the new one. Not too much trouble if there's not too many controls on the window.
1 件のコメント
Walter Roberson
2016 年 4 月 19 日
When I was systems administrator, my bosses used to be... displeased... at how much I insisted be spent on backup hardware and software. "We've never had a big problem, so is it worth it?" Back in the days when a 2 gigabyte hard drive would the budget badly. There were a couple of times when Brion or I had to rebuild the research systems from tape after the RAID drives flaked out; it did not happen often, but when it did it was a nuisance rather than a disaster.
その他の回答 (3 件)
Baltam
2016 年 4 月 19 日
I'm no expert. But I had lots of troubles with the GUIfigs and I just downloaded a matlab 'b'-version and the problems stopped.
Kind regards,
Baltam
0 件のコメント
nicolas thorne
2016 年 10 月 11 日
I know this isn't helpful but Matlab needs to find a better way of allowing it's users to make GUI's, my GUIDE files are constantly getting corrupted, although I'm sure there is a good reason for it I can't seem to find information on how to fix it or on how to avoid it.
2 件のコメント
Kristoffer Walker
2019 年 12 月 2 日
One way to corrupt *.fig files is to do a partial save accidentally by trying to save your *.fig file while open in GUIDE while the Matlab session is in the middle of a debugging session (where you are paused at one step in the code). This just happened to me. One also needs to be patient when moving around many objects that are selected by the mouse at one time--if you are not patient and try to close or save prematurely, you may find yourself corrupting the *.fig file.
参考
カテゴリ
Help Center および File Exchange で Whos についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!