standard deviation of a 3d matrix

29 Ansichten (letzte 30 Tage)
Donald
Donald am 5 Jul. 2011
Hello!
I have a 3-D matrix (test = rand[3,3,4]) and I want to get the standard deviation of each cell going through the 3rd dimension. Sean de wrote before that to get the mean through the third dimension, I can simply plug in:
grid = mean(test,3);
Simply changing 'mean' to 'std' does not do the trick and other attempts I've made didn't go very far. Any suggestions?
Thanks! Donald
  1 Kommentar
Sean de Wolski
Sean de Wolski am 5 Jul. 2011
Don't overwrite the useful function 'grid'.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Oleg Komarov
Oleg Komarov am 5 Jul. 2011
std(test,[],3)
The second argument refers to wheter you want the std to be corrected for the degrees of freedom or not. For more info:
doc std

Weitere Antworten (0)

Kategorien

Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by