This repository has been archived on 2021-05-17. You can view files and clone it, but cannot push or open issues or pull requests.
scientificComputing/simulations/code/normaldata.m

15 lines
330 B
Matlab

randn(1, 3)
randn(3, 1)
randn(2, 4)
mu = 220.0; % mean and ...
sigma = 30.0; % ... standard deviation of the tigers in kg
for n = [100, 10000]
fprintf('\nn=%d:\n', n)
for i = 1:5
x = sigma*randn(n, 1) + mu; % weights of n tigers
fprintf(' m=%3.0fkg, std=%3.0fkg\n', mean(x), std(x))
end
end