Initialization code not loading from GUI

Hi people. I have been learning MATLAB and have stumbled on an issue I imagine is an easy fix.
I have been developing a GUI code and ideally I want it to function so that when I double-click the project.fig file it will execute all the coding in the initialization. Basically these subfunctions:
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @DynoData_OpeningFcn, ...
'gui_OutputFcn', @DynoData_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
The code executes fine if I run it from the editor but they do not run if I run it from the directory folder next to the command window. Why?

 Akzeptierte Antwort

Amit
Amit am 26 Jan. 2014

0 Stimmen

Becuase project.fig file is just the figure file. There must be a project.m file. That is the executable file. You run that, it will be very similar to running the figure from the editor.

3 Kommentare

Amed
Amed am 26 Jan. 2014
Thank you for your help, I am still a novice. It feels tacky to click on the M-file and run the thing through the editor. I wish I could click a file in a Windows folder and then it would run as it should.
How do I best run the program so that I can just go strait to the GUI?
Amit
Amit am 26 Jan. 2014
In the command window, type project (as that is your GUI fig name and the m file associated with it's name)
Amed
Amed am 26 Jan. 2014
Thank you sir.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Gefragt:

am 26 Jan. 2014

Kommentiert:

am 26 Jan. 2014

Community Treasure Hunt

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

Start Hunting!

Translated by