MATLAB: Help with standard deviation 3d matrix

3d matrixMATLABstandard deviationstdstd2

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 šŸ™‚

Best Answer

stack_std = reshape(std( reshape( double(YourMatrix), [], size(YourMatrix,3) ) ), 1, 1, []);
Related Question