%% Estimate Approximate Entropy
% Use the Estimate Approximate Entropy task in the Live Editor to interactively estimate the approximate entropy of a uniformly sampled signal. Experiment with different values for lag, embedding dimension and radius. The task automatically generates code reflecting your selections.
% For this example, consider 'approxEntData.mat' which contains uniformly sampled signal X, embedding dimension dim, and the time delay lag.

load('approxEntData.mat','X','dim','lag')

%
% Use the Estimate Approximate Entropy task to estimate the approximate entropy of signal X. Experiment with different options and observe the value of approximate entropy in the Live Editor output. The task automatically generates and executes code for the parameters you specify.
%

% Compute approximate entropy of signal X
approxEnt = approximateEntropy(X, ...
    'Dimension', dim, ...
    'Lag', lag);

% Display the results
disp(approxEnt)

%
% Copyright 2019 The MathWorks, Inc.