MATLAB Creating Graphical User Interfaces
% This function has no output args, see OutputFcn. % hObject handle to figure % eventdata reserved - to be defined in a future v ...
Code Pop-Up Menu Behavior The pop-up menu presents options for plotting the data. When the user selects one of the three plots, ...
GUIDE displays the code file in the Editor, and moves the cursor to the pop-menu callback, which contains this code: % --- Execu ...
Value — the index into the menu contents of the selected data set The code then uses a switch statement to make the selected d ...
In the Editor, the cursor moves to the Surf push button callback in the code file, which contains this code: % --- Executes on b ...
Add this code to the Mesh push button callback, pushbutton2_Callback: % Display mesh plot of the currently selected data. mesh ...
See Also Related Examples “Ways to Build Apps” on page 1-2 “Create a Simple App Programmatically” on page 3-2 “Create and Run a ...
Files Generated by GUIDE In this section... “Code Files and FIG-Files” on page 2-24 “Code File Structure” on page 2-24 “Adding C ...
then the name of the main function is mygui. Each callback in the file is a local function of that main function. When GUIDE gen ...
Double-click a component to show its properties in the Property Inspector. In the Property Inspector, click the pencil-and-pap ...
code manually. For details, see “Renaming and Removing GUIDE-Generated Callbacks” on page 7-6. See Also Related Examples “Creat ...
...
A Simple Programmatic App 3 ...
Create a Simple App Programmatically NoteThis topic applies to apps you create programmatically using the figure function. For a ...
NoteThis code uses dot notation to set graphics object properties. Dot notation runs in R2014b and later. If you are using an ea ...
The Visible property is set to 'off' to make the window invisible as components are added or initialized. The window becomes vi ...
'String',{'Peaks','Membrane','Sinc'},... 'Position',[300,50,100,25]); The pop-up menu component String property uses a cell arra ...
'Position',[315,220,70,25]); hmesh = uicontrol('Style','pushbutton','String','Mesh',... 'Position',[315,180,70,25]); hcontour = ...
Code the App’s Behavior Program the Pop-Up Menu The pop-up menu enables users to select the data to plot. When a user selects on ...
% Push button callbacks. Each callback plots current_data in the % specified plot type. function surfbutton_Callback(source,even ...
«
1
2
3
4
5
6
7
8
9
10
»
Free download pdf