%% Use Bilevel Measurements Panel with Clock Input Signal
%% Create and Display Clock Input Signal
% Load the clock data, x and t. Find the sample time, ts.

load clockex
ts = t(2)-t(1);

%
% Create a dsp.TimeScope object and call the object to display the signal. To autoscale the axes and enable changes to property values and input characteristics, call release.

scope = dsp.TimeScope(1,1/ts,'TimeSpanSource','Auto');
scope(x);
release(scope)

%
%% Use Bilevel Measurements Panel to Find Settling Time
% 1. From the Time Scope menu, select Tools > Measurements > Bilevel Measurements.
% 2. Expand the Settings pane and the Overshoots / Undershoots pane.
% Initially, the Time Scope does not display the rising edge Settling Time parameter. This absence occurs because the default value of the Settle Seek parameter is longer than the entire simulation duration.
%
% 3. In the Settle Seek box, enter 2e-6 and press Enter.
% Time Scope now displays a rising edge Settling Time value of 118.392 ns.
% This settling time value is actually the statistical average of the settling times for all five rising edges. To show the settling time for only one rising edge, you can zoom in on that transition.
% 4. In the Time Scope toolbar, click the arrow next to the Zoom button, and then click the Zoom X button.
% 5. Click the display near a value of 2 microseconds on the time axis.
% 6. Drag your cursor right and release it near a value of 4 microseconds on the time axis.
% Time Scope updates the rising edge Settling Time value to reflect the new time window.
%
% 7. Close the Time Scope and remove the variables you created from the workspace.

clear scope x t ts

% Copyright 2012 The MathWorks, Inc.