% Associate each of the Matlab functions
%
min,
%
max,
%
sum,
%
prod,
%
cumsum,
%
cumprod,
%
mean,
%
median,
%
std
% with exactly one mathematical expression below. Then, compute the value
% of each mathematical expression by two different ways:
%
% - Using a single Matlab function
% - Using a for loop
%
% Compare your results to make sure you get the same result for each case.
%
% Put all of your commands into a script containing your solution to each
% problem. To start, first create an array
$x$ of 100 random values using the
rand function. For example,
%
%
% x = rand(100,1);
%
% You will use this array for each of the exercises.
%
%
Note: In most cases, it will be preferable to use the single
% Matlab command than the for loop!.
%
% -
% $\displaystyle{\sum_{k=1}^{n} x_k}$
% -
% $\displaystyle{\min_{1 \le k \le n} x_k}$
% -
% $\displaystyle{\frac{1}{n}\sum_{k=1}^n {x_k}}$
% -
% $\displaystyle{y_j = \prod_{k=1}^j {x_k}}$,
% for $j = 1,2,...,n$
% -
% $\displaystyle{\sqrt{\frac{1}{n-1}\sum_{k=1}^n (x_k - \mu)^2}}$,
% where $\displaystyle{\mu = \frac{1}{n}\sum_{k=1}^n
% x_k}$
% - $\displaystyle{n}$
%
- Find the value $\sigma$
% in $x$ such
% that half of the values $x_k$ are
% less than $\sigma$ and half are
% greater than $\sigma$.
% -
% $\displaystyle{\max_{1 \le k \le n} x_k}$
% -
% $\displaystyle{y_j = \sum_{k=1}^j {x_k}}$
% for $j = 1,2,...,n$
% -
% $\displaystyle{\prod_{k=1}^{n} x_k}$
%
%
%