Filter löschen
Filter löschen

Kurtosis ignoring 0s in matrix

1 Ansicht (letzte 30 Tage)
Mate 2u
Mate 2u am 24 Jul. 2012
Hi there, I was wondering I have a matrix A of size 295x34. I want to do the kurtosis, but want to ignore all zeros.
How can I do this?

Akzeptierte Antwort

Andrei Bobrov
Andrei Bobrov am 24 Jul. 2012
Bearbeitet: Andrei Bobrov am 24 Jul. 2012
out = cellfun(@(x)kurtosis(x(x~=0)),num2cell(A,1));
or
s = sum(A~=0);
x1 = bsxfun(@minus,A,sum(A)./s);
x1(A == 0) = 0;
out = s.*sum(x1.^4)./ sum(x1.^2).^2;

Weitere Antworten (0)

Kategorien

Mehr zu Interpolation finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by