%% Determine Settling Points of Three-Transition Bilevel Waveform
% Determine the settling points for a three-transition bilevel waveform. The data are sampled at 4 MHz. Specify a settle-seek duration of one microsecond.

load('transitionex.mat','x')
y = [x; fliplr(x)];
fs = 4e6;
t = 0:1/fs:(length(y)*1/fs)-1/fs;

[s,slev,sinst] = settlingtime(y,fs,1e-6);

%
% Plot the waveform and annotate the settling points.

settlingtime(y,fs,1e-6)

% Copyright 2012 The MathWorks, Inc.