Question on how to calculate the variance and then standard deviation on an interval from a to b with 100 samples of size 225 random numbers
Ältere Kommentare anzeigen
nsamples=100;
samplenum = 1:nsamples;
%setting number of samples and the sample amt. i.e. here there
%is only 1 sample of number 100
n = 225;
%sample size 225
a = 1;
%setting first mean value of 1
b = 2;
%setting second mean value of 2
a + (b-a)*rand()
%gives uniform random values in the interval [a,b]
((b-a)^2)/100
%calculating variance
d = (b-a)/sqrt(100)
%calculating standard deviation
Hi, so here I am wondering to calculate the variance and standard deviation should i be using:
(samplenum) instead of (b-a)?
I'm trying to generate 100 samples and then find the standard deviation
Also this part of the code:
c = (b+a)/2
%calculating mean of values of mean between a and b
should be calculating the mean values between a and b?
Thank you!
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Univariate Discrete Distributions finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!