MATLAB SIMULINK 7 - GRAPHICAL USER INTERFACE Specifikace Strana 142

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 216
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 141
4 Programming GUIs
4-22
handles.activex1.radius = ...
get(hObject, 'Value')*handles.default_radius;
handles.activex1.label = ...
['Radius = ' num2str(handles.activex1.radius)];
refresh(handles.figure1);
4 Add the following command to the opening function:
handles.default_radius = handles.activex1.radius;
5 Add the following command at the end of the code in the activex1_Click
callback:
set(handles.slider1, 'Value', ...
hObject.radius/handles.default_radius);
6 Run the GUI.
When you move the slider by clicking and dragging, the radius changes to a
new value between 0 and the default radius of 20, as shown in the following
figure.
The command
handles.activex1.radius = ...
get(hObject, 'Value')*handles.default_radius;
does the following:
Zobrazit stránku 141
1 2 ... 137 138 139 140 141 142 143 144 145 146 147 ... 215 216

Komentáře k této Příručce

Žádné komentáře