% Filename: MinMax.m
% M-file to
%   - calculate the minimum & maximum of an array
%   - display that min and max

% Create array
x = [20 45 81 6 -3 -23 99];

% Find minimum and maximum of array
minx = min(x);
maxx = max(x);

% Display the min & max using fprinft
fprintf('The max is %d\n',maxx)
fprintf('The min is %d\n',minx)
fprintf('The average of the min and max is %4.1f\n',(maxx+minx)/2);

