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

3 views (last 30 days)
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 Comments
Master
Master on 17 Oct 2023
Edited: Master on 17 Oct 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 on 17 Oct 2023
Edited: dpb on 17 Oct 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...

Sign in to comment.

Accepted Answer

dpb
dpb on 17 Oct 2023
Edited: dpb on 17 Oct 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 Comments
Master
Master on 17 Oct 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 on 17 Oct 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...

Sign in to comment.

More Answers (1)

Voss
Voss on 17 Oct 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.

Categories

Find more on Migrate GUIDE Apps in Help Center and File Exchange

Products


Release

R2022b

Community Treasure Hunt

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

Start Hunting!