50 lines
678 B
Plaintext
50 lines
678 B
Plaintext
|
; => permet de masquer la réponse
|
||
|
|
||
|
--------------------------
|
||
|
save "toto.sod"
|
||
|
export LIBGL_ALWAYS_SOFTWARE=1
|
||
|
scilab
|
||
|
load ("toto.sod")
|
||
|
----------------------------
|
||
|
Q2)
|
||
|
X=[3 1 5 3 2 7 0 1 0 3 2 4 4 0 3 3 2 5 3 1];
|
||
|
M=tabul(X,"i")
|
||
|
|
||
|
Q3)
|
||
|
tri les valeur par ordre croissant
|
||
|
|
||
|
Q4)
|
||
|
f=M(:,2)
|
||
|
v= f/length(X)
|
||
|
|
||
|
Q5)
|
||
|
n=M(:,1)
|
||
|
|
||
|
Q6)
|
||
|
pour trouver les fréquences cumulées:
|
||
|
fcc = cumsum(v)
|
||
|
bar (n,fcc)
|
||
|
|
||
|
Q7)
|
||
|
pour trouver le mode:
|
||
|
modeX = X(find(v == max(v)))
|
||
|
|
||
|
Q8)
|
||
|
Pour calculer la moyenne, 3 possibilitées:
|
||
|
- mu = sum(n.*f)
|
||
|
- mu = mean(X)
|
||
|
- mu = sum(X)/length(X)
|
||
|
|
||
|
Q9)
|
||
|
Pour trouver les quartiles:
|
||
|
Xtrie = gsort(X,'c','i')
|
||
|
quartile1 = Xtrie(length(X)/4)
|
||
|
quartile3 = Xtrie(3*length(X)/4)
|
||
|
|
||
|
Q10)
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|