How to implement this formula in MatLab?

 Respuesta aceptada

directly:
n=100;
x=rand(1,n);
s=std(x)
or with a loop:
n=100;
x=rand(1,n);
xmean=mean(x);
sumt=0;
for i=1:n
sumt=sumt+(x(i)-xmean)^2;
end
s=sqrt(sumt/(n-1))

Más respuestas (0)

Categorías

Más información sobre Startup and Shutdown en Centro de ayuda y File Exchange.

Productos

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by