load thymusglandweights.dat n = 10; x = thymusglandweights; m = 5000; for i = 1:m idx = randi(length(x), n,1); y = x(idx); [h,p] = ttest(y, 34.3); if h == 1 disp(['p-value: ', num2str(p)]); disp(['mu: ', num2str(mean(y))]); disp(['mu total: ', num2str(mean(x))]); break end end