MATLAB SIMULINK 7 - GRAPHICAL USER INTERFACE Manual de usuario Pagina 274

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 500
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 273
9 Examples of GUIDE UIs
9-28
Plot Data
The final task for the plot_button_Callback is to generate two plots. This involves:
Targeting plots to the appropriate axes. For example, this code directs a graph to the
time axes:
plot(handles.time_axes,t,x)
Providing the appropriate data to the plot function
Turning on the axes grid, which the plot function automatically turns off
Note: Performing the last step is necessary because many plotting functions (including
plot) clear the axes and reset properties before creating the graph. This means that
you cannot use the Property Inspector to set the XMinorTick, YMinorTick, and grid
properties in this example, because they are reset when the callback executes plot.
In the following code listing, notice how the handles structure provides access to the
handle of the axes, when needed.
Plot_Button Callback
function plot_button_Callback(hObject, eventdata, handles, varargin)
% hObject handle to plot_button (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get user input
f1 = str2double(get(handles.f1_input,'String'));
f2 = str2double(get(handles.f2_input,'String'));
t = eval(get(handles.t_input,'String'));
% Calculate data
x = sin(2*pi*f1*t) + sin(2*pi*f2*t);
y = fft(x,512);
m = y.*conj(y)/512;
f = 1000*(0:256)/512;
% Create frequency plot in proper axes
plot(handles.frequency_axes,f,m(1:257))
set(handles.frequency_axes,'XMinorTick','on')
grid on
% Create time plot in proper axes
plot(handles.time_axes,t,x)
set(handles.time_axes,'XMinorTick','on')
grid on
Vista de pagina 273
1 2 ... 269 270 271 272 273 274 275 276 277 278 279 ... 499 500

Comentarios a estos manuales

Sin comentarios

LG 24MB65PY manuals

Owner’s manuals and user’s guides for DVD players LG 24MB65PY.
We providing pdf manuals LG 24MB65PY for download free by document types:






More products and manuals for DVD players LG

Models Document Type
DN788 User Manual   LG DN788 User's Manual, 24 pages
HT355SD-A2 User Manual    LG HT355SD-A2 User's Manual, 32 pages
DV8931H User Manual    LG DV8931H User's Manual, 54 pages
HTW316 User Manual   LG HTW316 User's Manual, 40 pages
DVX9900H User Manual   LG DVX9900H User's Manual, 31 pages
ZDX-313 User Manual   LG ZDX-313 User's Manual, 40 pages
DVX642H User Manual   LG DVX642H User's Manual, 24 pages
DNX190UH User Manual   LG DNX190UH User's Manual, 26 pages
DVT699H User Manual   LG DVT699H User's Manual, 28 pages
DR787T Specifications   LG DR787T Specifications, 2 pages
LRM LRM-519 User Manual   LG LRM LRM-519 User's Manual, 2 pages
HT306SU User Manual   LG HT306SU User manual, 38 pages
DVX692H User Manual   LG DVX692H User manual, 24 pages
LHX-557 User Manual   LG LHX-557 User's Manual, 56 pages
VT 4015 User Manual    LG VT 4015 User's Manual, 28 pages
LH-T1000 User Manual   LG LH-T1000 User's Manual, 36 pages
DGK775 User Manual    LG DGK775 User manual, 50 pages
LDA-730 User Manual    LG LDA-730 User's Manual, 44 pages
DH4220S User Manual   LG DH4220S User's Manual, 40 pages
DVT589H User Manual   LG DVT589H User's Manual, 22 pages