MATLAB: Petrosian fractal entropy estimation

entropypetrosian fractal entropy

can any one help me in writing petrosian fractal entropy in matlab? here is the formula: P F D = log10N/ [log10N + log10(N/(N + 0.4M))] where N refers to the number of the signal samples and M is the number of the sign changes in the signal derivative

Best Answer

Hi,
you can use a function handle to do this:
PFD = @(N,M) log10(N)/ (log10(N) + log10(N/(N + 0.4*M)))
To calculate values with this use either:
example_result = PFD(3,5)
or use variables:
N = 3
M = 5
Example2 = PFD(N,M)
Both give you the same result.
Best regards
Stephan
Related Question