How can I write this formula in Matlab?

How can I write this formula in Matlab? Σ ( Xi - X )2 / N
Thanks

2 Comments

Omim - this seems like homework where you are expected to determine the variance of N equally likely values. Is this the case? What have you tried so far?
I have tried to write it with symsum, but I receive an error becsuse the numere are în duble format

Sign in to comment.

Answers (2)

You might be calculating the variance if ‘X’ is actually the mean of your vector. In that instance, the code would be:
VarX = var(X,1);

Asked:

on 28 Mar 2016

Answered:

on 28 Mar 2016

Community Treasure Hunt

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

Start Hunting!