How to implement this formula in MatLab?

1 次查看(过去 30 天)
n is a constant = 100
x is an array of 100 rand elements

采纳的回答

JESUS DAVID ARIZA ROYETH
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))

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by