%% Slew Rates for Three-Transition Waveform
% Create a bilevel waveform with three transitions, two positive and one negative. The sample rate is 4 MHz. Obtain the slew rates for the three transitions.

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

y = [x;fliplr(x)];
t = (0:length(y)-1)/4e6;

S = slewrate(y,t)

%
% Annotate the result on a plot of the waveform.

slewrate(y,t);

% Copyright 2015 The MathWorks, Inc.