標準偏差(std)の重みについて
    4 visualizzazioni (ultimi 30 giorni)
  
       Mostra commenti meno recenti
    
stdを使用する際に値が0である行列を数えないで正規化したいのですが、何か良い方法はありますか?
ご教授お願いいたします。
2 Commenti
Risposta accettata
  Hernia Baby
      
 il 16 Mag 2022
        std のオプションにNaNを除外する機能がありますので、0をNaNにしましょう
まずはデータを用意します
A = randi([-5 5],9)
0をNaNにします
A(A==0) = nan()
NaNを除外して計算します
std(A,'omitnan')
Più risposte (0)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
