Why cannot run the coding ?

조회 수: 12 (최근 30일)
MAVIS LIM
MAVIS LIM 2018년 4월 21일
댓글: MAVIS LIM 2018년 4월 29일
Please help me with my problem, i cannot run the file that and command window write there is an error, can someone told me what is that error because i not understand
Error using load
Unable to read MAT-file . Not a binary MAT-file. Try LOAD
-ASCII to read as text.
Error in matlab.graphics.internal.figfile.FigFile/read (line 36)
hgDataVars = load(filename, '-mat', '-regexp', '^hg[M]');
Error in matlab.graphics.internal.figfile.FigFile (line 104)
Error in loadFigure (line 31)
Error in openfig>localOpenFigure (line 73)
h = loadFigure(filename, visibleAction);
Error in openfig (line 47)
figOut = localOpenFigure(filename, reuse, visibleAction);
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 gui (line 42)
gui_mainfcn(gui_State, varargin{:});

답변 (1개)

Walter Roberson
Walter Roberson 2018년 4월 21일

In order to run your code with the name "gui", there needs to be a "gui.fig" file. That file needs to be a MATLAB binary .mat file internally. In MATLAB, .fig files are .mat files with particular variables stored in them.

MATLAB is looking at your .fig file and finding that it is not a .mat file internally.

Perhaps at some point you did something like imwrite() of an image on top of the .fig file.

You should use your operating system to have a look to see what it thinks the file is. On Mac and Linux you could

   !file gui.m

to try to identify the file contents.

You will probably need to recreate the gui.fig file -- or restore it from backup.

  댓글 수: 1
MAVIS LIM
MAVIS LIM 2018년 4월 29일
Thank you Walter !

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by