Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // polnjenje vektorja z naključnimi števili
- P = [];
- for i=1:1:10;
- P(i) = randi([1, 100]);
- end;
- // izračun povprečja
- vsota = 0;
- for i=1:1:10;
- vsota = vsota + P(i);
- end;
- povcprecje = vsota / 10;
- // standardna deviacija
- vsotaStd = 0;
- for i=1:1:10;
- vsotaStd = vsotaStd + (P(i) - povprecje)^2;
- end;
- std = sqrt(vsotaStd);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement