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

1 次查看(过去 30 天)
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 个评论
Master
Master 2023-10-17
编辑:Master 2023-10-17
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 2023-10-17
编辑:dpb 2023-10-17
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...

请先登录,再进行评论。

采纳的回答

dpb
dpb 2023-10-17
编辑:dpb 2023-10-17
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 个评论
Master
Master 2023-10-17
Ohh, I see. Thank you and I'll try to convert it now and check if it would work. Thank you again!
dpb
dpb 2023-10-17
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...

请先登录,再进行评论。

更多回答(1 个)

Voss
Voss 2023-10-17
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.

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

产品


版本

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by