%% Duty Cycle of Bilevel Waveform with Sample Rate
% Determine the duty cycle of a bilevel waveform. The sample rate is 4 MHz.

load('pulseex.mat','x','t')
fs = 1/(t(2)-t(1));

d = dutycycle(x,fs)

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

dutycycle(x,fs);

% Copyright 2015 The MathWorks, Inc.