Kurtosis ignoring 0s in matrix
조회 수: 2 (최근 30일)
이전 댓글 표시
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
채택된 답변
Andrei Bobrov
2012년 7월 24일
편집: Andrei Bobrov
2012년 7월 24일
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
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Get Started with Statistics and Machine Learning Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!