Matlab: Why is my plot not converging? -


would able me understand why plot not converge? missing code? plotting mean , variance against number of trials. thx

samplesize = 10; trialsize = 1000;  firstvector = [1:trialsize]; vectorb = zeroes(trialsize,1); vectorc = zeroes(trialsize,1)  i=1:trialsize    v1 = rand(samplesize, 1)    vectorb(i) = mean(v1);    vectorc(i) = var(v1); end  plot(firstvector,vectorb) plot(firstvector,vectorc) 

is wanted do? take mean , var of 10 more samples @ time? 1st loop take 10, next 20, next 30 .... 1000 times?

before taking mean , var of 10 random samples @ time ... never going converge.

samplesize = 10; trialsize = 1000;  firstvector = [1:trialsize]; vectorb = zeros(trialsize,1); vectorc = zeros(trialsize,1); v1 = rand(trialsize*samplesize, 1); i=1:trialsize    vectorb(i) = mean(v1(1:i*samplesize));    vectorc(i) = var(v1(1:i*samplesize)); end  subplot(2,1,1);plot(firstvector,vectorb) subplot(2,1,2);plot(firstvector,vectorc) 

example plot


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -