%% Histogram Counts and Histogram Bin Centers
% Estimate the low- and high-state levels of 2.3 V underdamped clock data sampled at 4 MHz. Return the histogram counts and histogram bin centers used in the histogram method. Use four bins.

load('clockex.mat','x','t')
[levs,histog,bilevs] = statelevels(x,4)

%
% Plot the waveform and annotate the levels.

statelevels(x,4)

% Copyright 2015 The MathWorks, Inc.