From: sscnekro on
> mean works "columnwise"

Sorry, typo. This is true just in the specific context as described above. If P is 1 x n, mean(P) will return a 1 x 1 result. By the way, mean can be specified as mean(P, dimension), check out help doc.