MATLAB Creating Graphical User Interfaces
Callbacks for Specific Components if strcmp(get(hObject,'Checked'),'on') set(hObject,'Checked','off'); else set(hObject,'Checked ...
8 Programming a GUIDE UI Sums all the selected values and displays the result in the Command Window. This code is an example o ...
Callbacks for Specific Components function axes1_ButtonDownFcn(hObject, eventdata, handles) % hObject handle to axes1 (see GCBO) ...
8 Programming a GUIDE UI Note:Most MATLAB plotting functions clear the axes and reset a number of axes properties, including the ...
Examples of GUIDE UIs Examples of GUIDE UIs The following are examples that are packaged with MATLAB. The introductory text for ...
...
9 Examples of GUIDE UIs “Modal Dialog Box in GUIDE” on page 9- 2 “UI That Uses Persistent Data” on page 9- 7 “UI That Accepts P ...
9 Examples of GUIDE UIs Modal Dialog Box in GUIDE In this section... “About the Example” on page 9- 2 “Set Up the Close Confirma ...
Modal Dialog Box in GUIDE 4 In the Layout Editor, right-click the static text, Do you want to create a question dialog?, and sel ...
9 Examples of GUIDE UIs The code file, closedlg.m, opens in the Editor. On the Editor tab, in the Navigate section, click Go To, ...
Modal Dialog Box in GUIDE 3 Click Yes or No. Yes closes both dialog boxes. No closes just the Confirm Close dialog box. How Cl ...
9 Examples of GUIDE UIs delete(handles.figure1) 6 When the UI with the Close button regains control, it receives the string Yes ...
UI That Uses Persistent Data UI That Uses Persistent Data In this section... “About the Example” on page 9- 7 “Calling Syntax” o ...
9 Examples of GUIDE UIs copyfile(fullfile(docroot, 'techdoc','creating_guis',... 'examples','addr*.*')),... fileattrib('addr*.*' ...
UI That Uses Persistent Data strcmpi(varargin{1},'book') && ... (2 == exist(varargin{2},'file'))) Check_And_Load(varargi ...
9 Examples of GUIDE UIs end if exist(file,'file') == 2 data = load(file); end % Validate the MAT-file % The file is valid if the ...
UI That Uses Persistent Data Open and Load MAT-File The address book UI contains a File > Open menu option for loading addres ...
9 Examples of GUIDE UIs If you create a new entry, you must save the MAT-file using the File > Save menu. The Contact_Name_ ...
UI That Uses Persistent Data switch Answer case 'Yes' Addresses(end+1).Name = Current_Name; % Grow array by 1 Addresses(end).Pho ...
9 Examples of GUIDE UIs case 'Yes' % If no name match was found create a new contact Addresses(handles.Index).Phone = Current_Ph ...
«
8
9
10
11
12
13
14
15
16
17
»
Free download pdf