Does C++ have built in function for finding mean and variance of a sequence of numbers?
Also if I have an expression
(a - b) and I would like it squared, is there an equivalent to Matlab's
(a - b)^2?
The reason I ask that is that if I have to write out variance calculation mannually, I'd have to say:
Any suggestions please?Code:sqrt( (a-mean)^2 + (b-mean)^2 + ... + (n-mean)^2)/n) // My inputs have quite long names and it would look clumbersome to say sqrt( (a-mean)*(a-mean) + (b-mean)* (b-mean) + ... + (n-mean)*(n-mean))/n)