%% First and Second Transition Times for Bilevel Waveform
% Compute the initial and final transition occurrences for a bilevel waveform sampled at 4 MHz.

load('pulseex.mat', 'x', 't');
fs = 4e6;

[w,initcross,finalcross] = pulsewidth(x,fs);

%
% Plot the result, annotated with the transition occurrences.

pulsewidth(x,fs);
ax = gca;
ax.XTick = [initcross finalcross];

% Copyright 2015 The MathWorks, Inc.