What is the best way to transform a function in a guide?
Show older comments
I have a complete and complex function and i would like to turn it in a guide, i want to know what is the best way to do it.
Accepted Answer
More Answers (2)
Azzi Abdelmalek
on 25 Sep 2013
Edited: Azzi Abdelmalek
on 25 Sep 2013
0 votes
Jan
on 26 Sep 2013
GUIDE is a toolbox to create an M-file and and FIG-file to create a dialog and the corresponding callbacks. You can create equivalent files manually also, see the famous FEX: 41 GUI examples.
Example:
function myGUI
FigH = figure( ...
'Name', 'My GUI', ...
'IntegerHandle', 'off', ...
'WindowStyle', 'normal', ...
'Visible', 'on', ...
'MenuBar', 'none', ...
'NumberTitle', 'off', ...
'Resize', 'off', ...
'Units', 'pixels', ...
'Position', [100, 100, 500, 400], ...
'NextPlot', 'add', ...
'BusyAction', 'cancel', ... % Block new actions during computing
'Color', DlgBG, ...
'Tag', DlgTag, ...
'DeleteFcn', @CloseGUI, ...
'CloseRequestFcn', @CloseGUI);
uicontrol('Style', 'Pushbutton', 'Position', [10, 10, 80, 30], ...
'String', 'close', ...
'Callback', @CloseGUI);
function CloseGUI(ObjectH, EventData)
FigH = ancestor(ObjectH, 'figure');
disp('Closing the figure');
delete(FigH);
1 Comment
Rita Grosso
on 26 Sep 2013
Categories
Find more on Interactive Control and Callbacks 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!