MATLAB: Standard deviation of two elements of a 3d matrix

std

Greetings,
I have a 672 x 32 x 2800 matrix that I need to chop into a 672 x 2800 matrix but the rows need to be the standard deviation of the columns in the original 3d matrix. Here is what I am doing which is all wrong
new_col_data = zeros(672,2800);
new_col_data = [std(data, 0, 2),:]
I cannot figure this out. Can someone please tell me what is wrong?
Thank you

Best Answer

A = rand(672,32,2800); % Some random data:
B = std(A,[],2); % Compute the standard deviation
B = squeeze(B); % Squeeze it