% Solution Exerise 1b, last task 10.
% The mean of a vector x

% Alternative 1
% Define a vector x, it could be any set of observations
N=100;
x=rand(N,1);

x_mean=x(1);
for i=2:N
    x_mean=x_mean + x(i)
end
x_mean=x_mean/N

% Alternative 2
x_mean=mean(x)    % Use the bult in function to calculate t