フィルターのクリア

nanstd use in matlab

13 ビュー (過去 30 日間)
Feihao Sun
Feihao Sun 2021 年 11 月 17 日
回答済み: Chunru 2021 年 11 月 17 日
Hi, For Matlab, I wonder how to use nanstd to calculate the standard deviation of a 3D matrix with NaN values.
Right now assuming a 3-D matrix A_3D
I used A_std = nanstd(A_3D, [],3);
assuming the first numbers in the 3D matrix is 0.3735 and 0.3477 respectively,
using my code would give me a standard deviation of 0.0182 but in reality, it should be 0.0129, I don't know what is going on and I didn't find answers online

採用された回答

Chunru
Chunru 2021 年 11 月 17 日
You are using default normalization "[]", which normalised the std by (N-1). If you want to get 0.0129, you need to change [] into 1.
nanstd([0.3735; 0.3477])
ans = 0.0182
nanstd([0.3735; 0.3477], 1)
ans = 0.0129

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMultidimensional Arrays についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by