Kurtosis ignoring 0s in matrix
1 回表示 (過去 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 で MATLAB Report Generator についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!