Kurtosis ignoring 0s in matrix
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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?
0 comentarios
Respuesta aceptada
Andrei Bobrov
el 24 de Jul. de 2012
Editada: Andrei Bobrov
el 24 de Jul. de 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;
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Interpolation en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!