%% State Levels Using Means of Subhistograms
% Estimate the low- and high-state levels of 2.3 V underdamped clock data sampled at 4 MHz.
% Use the default number of bins and means of the subhistograms to estimate the state levels. Plot the clock data with the lines indicating the estimated low- and high-state levels.

load('clockex.mat','x','t')

statelevels(x,1e3,'mean')

% Copyright 2015 The MathWorks, Inc.