I'm new to MATLAB GUI and want to ask for help

3 visualizaciones (últimos 30 días)
Master
Master el 17 de Oct. de 2023
Comentada: dpb el 17 de Oct. de 2023
So I was looking for some examples of GUI and then I found a file in this community. I was going to check if how does the GUI look and check for the codes that were used. However, when I tried to run the .m file, it shows error which is attached in this post. I hope you help me as I am new to doing GUI in MATLAB.
  3 comentarios
Master
Master el 17 de Oct. de 2023
Editada: Master el 17 de Oct. de 2023
d=dir('*.m');
readlines(d.name)
Thank you for your response! But I was wondering if where should I put these commands?
In addition, do I need the .fig file to be able to run this? If so, I do not currently have any of that file since I was only able to have the .m file.
dpb
dpb el 17 de Oct. de 2023
Editada: dpb el 17 de Oct. de 2023
Nowhere, I was just echoing out the content of the m file to see what it contained without downloading it from the site....see the Answer to the Q? I posted after seeing that...

Iniciar sesión para comentar.

Respuesta aceptada

dpb
dpb el 17 de Oct. de 2023
Editada: dpb el 17 de Oct. de 2023
The problem running the function is that it expects there to be an already-existing .fig file that you didn't download with the m file. As the help message shows, it's the same root filename but with a .fig extension.
However, as the help info
help imageprocessinggui
IMAGEPROCESSINGGUI MATLAB code for imageprocessinggui.fig IMAGEPROCESSINGGUI, by itself, creates a new IMAGEPROCESSINGGUI or raises the existing singleton*. H = IMAGEPROCESSINGGUI returns the handle to a new IMAGEPROCESSINGGUI or the handle to the existing singleton*. IMAGEPROCESSINGGUI('CALLBACK',hObject,eventData,handles,...) calls the local function named CALLBACK in IMAGEPROCESSINGGUI.M with the given input arguments. IMAGEPROCESSINGGUI('Property','Value',...) creates a new IMAGEPROCESSINGGUI or raises the existing singleton*. Starting from the left, property value pairs are applied to the GUI before imageprocessinggui_OpeningFcn gets called. An unrecognized property name or invalid value makes property application stop. All inputs are passed to imageprocessinggui_OpeningFcn via varargin. *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one instance to run (singleton)". See also: GUIDE, GUIDATA, GUIHANDLES
indicates, it was built with GUIDE which has been deprecated and should not be used for new GUI development; <use App Designer> instead.
That said, it might be an interesting exercise to see about <converting the above from GUID to AppDesigner>
  2 comentarios
Master
Master el 17 de Oct. de 2023
Ohh, I see. Thank you and I'll try to convert it now and check if it would work. Thank you again!
dpb
dpb el 17 de Oct. de 2023
Good luck. You'll still need the associated figure in the missing .fig file, however; that's where all the gui stuff is in a GUIDE app...

Iniciar sesión para comentar.

Más respuestas (1)

Voss
Voss el 17 de Oct. de 2023
m-files created with GUIDE require an associated .fig file of the same name. You should go back to where you found the m-file and download the associated .fig file as well.

Categorías

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

Productos


Versión

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by