Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # polnjenja vektorja z 10 naključnimi števili
- P = [];
- for i=1:1:10;
- P(i) = randi([1, 100]);
- end;
- # računanje povprečja
- vsota = 0;
- for i=1:1:10;
- vsota = vsota + P(i);
- end;
- povprecje= vsota / 10;
- # računanje standardne deviacije
- vsotaStd = 0;
- for i=1:1:10;
- vsotaStd = vsotaStd + (P(i) - povprecje)^2;
- end;
- std = sqrt(vsotaStd);
- # risanje
- plot(P, "k", povprecje, ['r'], std, "b");
- xlabel("vzorec");
- ylabel("amplituda");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement