Matlab GUI problem using load

11 visualizaciones (últimos 30 días)
Hafizuddin Bin Mohd Lowhim
Hafizuddin Bin Mohd Lowhim el 3 de Ag. de 2020
Comentada: Rik el 27 de Jun. de 2022
Dear Matlab community,
I have this code where it is written in 2017b, I face problem when I run in Matlab 2019b. Here is the error and attached m file. It should creat a GUI that has user interface like below but the code is looking for the figure that doesn't exist. Please help me.
Error using load
Unable to read file 'HW_03.fig'. No such file or directory.
Error in matlab.graphics.internal.figfile.FigFile/read (line 31)
hgDataVars = load(filename, '-mat', '-regexp', '^hg[M]');
Error in matlab.graphics.internal.figfile.FigFile
Error in hgload (line 54)
FF = matlab.graphics.internal.figfile.FigFile(filename);
Error in matlab.hg.internal.openfigLegacy (line 57)
[fig, savedvisible] = hgload(filename, struct('Visible','off'));
Error in gui_mainfcn>local_openfig (line 286)
gui_hFigure = matlab.hg.internal.openfigLegacy(name, singleton, visible);
Error in gui_mainfcn (line 158)
gui_hFigure = local_openfig(gui_State.gui_Name, gui_SingletonOpt, gui_Visible);
Error in HW_03 (line 38)
gui_mainfcn(gui_State, varargin{:});

Respuestas (1)

sahq_azhar
sahq_azhar el 25 de Sept. de 2021
The same thing happened to me. I made a file back in 2017 and wanted to update it, but an error message appeared indicating that I was missing the.fig file.
To solve this just create a new GUI using Guide
enter guide in Command Window
and guide window will pop up create a the same GUI you needed and copy the previous call backs and functions from the old .m file.
I hope this helps.
  2 comentarios
x Wang
x Wang el 27 de Jun. de 2022
what ? mine poped up an empty GUI
Rik
Rik el 27 de Jun. de 2022
GUIDE is being deprecated. For advice about how to create a GUI, read this thread.

Iniciar sesión para comentar.

Categorías

Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by