integrating a gui with a program
Show older comments
function varargout = interface(varargin)
function interface_OpeningFcn(hObject, eventdata, handles, varargin)
function varargout = interface_OutputFcn(hObject, eventdata, handles)
function Vel_Callback(vel, eventdata, handles)
function Vel_CreateFcn(vel, eventdata, handles)
this is the gui structure I have created, inside each function there is more code (some of them automatically created by MatLab) the idea is that I want to select a value of velocity from a pop up menu and I want to use the value chosen in a big program with tons of calculations where I must introduce the program to have the results of the program in the workspace
the idea a what to develop is 1.introduce some values with pop-up menus transfer the values to the workspace and there use them as constant for the program I have developed in other script
2. used the values in some calculation
I know is tricky but I have to programs a GUI and m file and I don't know how I can integrate them together
Accepted Answer
More Answers (1)
Patrick Brown
on 28 Jan 2017
0 votes
1 Comment
Jan
on 28 Jan 2017
@Patrick: guidata(H, Data) uses setappdata internally to store the variable "Data" in the 'ApplicationData' property of the GUI object with the handle H. To obtain the stored data use: Data = guidata(H), which calls getappdata internally. For further explanations and examples read doc guidata.
Categories
Find more on App Building in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!