fedvasu
fedvasu

Reputation: 1252

raw moments command in Matlab?

In octave I can get raw moment of of any sample like this,

rm = moment(x,2,'r');

But there doesn't seem to be such option Matlab.

Am I missing something?

Upvotes: 0

Views: 1012

Answers (1)

Luis Mendo
Luis Mendo

Reputation: 112749

I don't know of a predefined function, but it's very easy. The n-th raw moment of the samples contained in vector x is

mean(x.^n)

If x is matrix and you want the raw moment of each colum:

mean(x.^n, 1)

Upvotes: 2

Related Questions