RosettaCodeData/Task/Cumulative-standard-deviation/MATLAB/cumulative-standard-deviation-1.m

8 lines
118 B
Mathematica
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
x = [2,4,4,4,5,5,7,9];
n = length (x);
m = mean (x);
x2 = mean (x .* x);
dev= sqrt (x2 - m * m)
dev = 2