% cs3113f08HW02P01.m
% K. Ming Leung, September 21, 2008
% 10 pts total

clear;

n = 5; m = 4;
rand('state',7);
format short;
MTX = [ transpose(1:n+1) [ linspace(0.1,pi,m); rand(n,m) ] ],   % 2 pt

MTX2 = MTX;
MTX2(2,2) = MTX2(2,2) + MTX2(2,4),  % 1 pt

MTX3 = MTX;
MTX3(4,end) = mean(MTX(:,3)),   % 1 pt

MTX4 = MTX;
MTX4(end,end) = sum(sum(MTX)),  % 2 pt

MTX5 = MTX(2:end-1,2:end-1),    % 2 pt, best method
% give credit if done like this:
MTX5 = MTX;
MTX5(1,:) = [];
MTX5(end,:) = [];
MTX5(:,1) = [];
MTX5(:,end) = [],       % 2 pt

MTX6 = MTX;
MTX6(:,end-1) = [],     % 1 pt

MTX7 = MTX;
MTX7([1,3,4],:) = [],   % 1 pt

% MTX =
% 
%     1.0000    0.1000    1.1139    2.1277    3.1416
%     2.0000    0.2381    0.9164    0.4392    0.9670
%     3.0000    0.0388    0.8002    0.3574    0.3783
%     4.0000    0.9320    0.1726    0.7232    0.8644
%     5.0000    0.5062    0.4761    0.0557    0.9059
%     6.0000    0.3033    0.5269    0.2351    0.9179
