www.gusucode.com > signal 案例源码程序 matlab代码 > signal/LowerAndUpperTransitionTimesExample.m

    %% Lower and Upper Transition Times
% Return the lower- and upper-transition times for a three-transition
% waveform sampled at 4 MHz.

% Copyright 2015 The MathWorks, Inc.


%%

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

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

[~,LT,UT] = slewrate(y,t)

%%
% Repeat using the sample rate instead of the time vector.

[~,LT,UT] = slewrate(y,fs)

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

slewrate(y,fs);