www.gusucode.com > dsp 案例源码程序 matlab代码 > dsp/UseBilevelMeasurementsPanelWithClockInputSignalExample.m

    %% Use Bilevel Measurements Panel with Clock Input Signal
% This example shows how to use the Time Scope Bilevel Measurements panel.
%%
% At the MATLAB(R) command prompt, type <matlab:ex_timescope_clockex 
% ex_timescope_clockex> to open the example model. The following Simulink(R)
% model appears. 
%
% <<../timescope_example4_model_clock.png>>
%
% In this example, Simulink(R) imports the variable |x|, from the MATLAB(R) 
% workspace. This variable is created when the model loads because the 
% commands that construct it reside in the model Preload function. To view 
% these commands, in the Simulink(R) menu, select |File > Model Properties 
% > Model Properties|. The Model Properties dialog box appears. Click the 
% |Callbacks| tab. The following lines of MATLAB(R) code appear.
load clockex;
ts = t(2)-t(1);
%%
% Run your model to see the time domain output. To show the |Bilevel
% Measurements| panel, in the Time Scope menu, select |Tools > Measurements
% > Bilevel Measurements|. Collapse the |Transitions| section, click the 
% arrow next to the section label. Expand the |Settings| and 
% |Overshoots/Undershoots| sections, click the arrow next to each label. 
% The Time Scope appears as shown in the following figure. 
%
% <<../scopes_clock_bilevel.png>>
%
%%
% The value for the rising edge |Settling Time| parameter is not displayed 
% initially because the default value for the |Settle Seek| parameter
% is too large for this example. Here, the settle seek time is longer than 
% the entire simulation duration. Enter a value for |Settle seek| of 2e-6
% and press the Enter key. The Time Scope now displays a rising edge 
% settling time value of 118.392 ns. 
%
% The settling time value displayed is the statistical average of the
% settling times for all five rising edges. To show the settling time for 
% one rising edge, zoom in on that transition. In the Time Scope toolbar, 
% click the Zoom X button.. Click the display near a value of 2 
% microseconds on the time-axis. Drag to the right and release near a value
% of 4 microseconds on the time-axis. The Time Scope updates the rising 
% edge settling time value to reflect the new time window, as shown in the 
% following figure. 
%
% <<../scopes_clock_bilevel_zoomx.png>>