How to implement this formula in MatLab?

1 vue (au cours des 30 derniers jours)
Serhii Sheinych
Serhii Sheinych le 25 Nov 2019
Commenté : Serhii Sheinych le 25 Nov 2019
n is a constant = 100
x is an array of 100 rand elements

Réponse acceptée

JESUS DAVID ARIZA ROYETH
JESUS DAVID ARIZA ROYETH le 25 Nov 2019
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))

Plus de réponses (0)

Catégories

En savoir plus sur Get Started with MATLAB dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by