標準偏差(std)の重みについて
3 views (last 30 days)
Show older comments
stdを使用する際に値が0である行列を数えないで正規化したいのですが、何か良い方法はありますか?
ご教授お願いいたします。
Accepted Answer
Hernia Baby
on 16 May 2022
std のオプションにNaNを除外する機能がありますので、0をNaNにしましょう
まずはデータを用意します
A = randi([-5 5],9)
0をNaNにします
A(A==0) = nan()
NaNを除外して計算します
std(A,'omitnan')
More Answers (0)
See Also
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!