help with standard deviation 3d matrix

3 ビュー (過去 30 日間)
itend
itend 2017 年 6 月 11 日
コメント済み: itend 2017 年 6 月 11 日
I have a 3D matrix of size (600 x 800 x 322) unit 16.
I would like to take the standard deviation of each 600 x 800 matrix -- I am trying to get a result matrix size 1 x 1 x 322 containing the standard deviation of each matrix in this "stack".
I have tried using the std and std2 function, but haven't been able to get this to work.
Please help :)

採用された回答

Walter Roberson
Walter Roberson 2017 年 6 月 11 日
stack_std = reshape(std( reshape( double(YourMatrix), [], size(YourMatrix,3) ) ), 1, 1, []);
  1 件のコメント
itend
itend 2017 年 6 月 11 日
Brilliant, thanks!

サインインしてコメントする。

その他の回答 (1 件)

the cyclist
the cyclist 2017 年 6 月 11 日
Reshape the matrix before taking the standard deviation, then reshape back:
M = rand(600,800,322);
M_r = reshape(M,480000,322);
sd_r = std(M_r);
sd = reshape(sd_r,[1 1 322]);
  1 件のコメント
itend
itend 2017 年 6 月 11 日
Awesome, thanks :)

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeResizing and Reshaping Matrices についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by