How to compute Expectation in MatLab?
Show older comments
Hello Guys,
I need to compute E{x^4} in MatLab (x is vector). Can it be done by taking the mean value of x^4 (each element of x exponent 4).
Thanks for the help. Regards
Accepted Answer
More Answers (1)
Star Strider
on 25 Sep 2014
That is how I would do it, using element-wise exponentiation:
Ex4 = mean(x.^4);
Categories
Find more on Mathematics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!