%-- 10:13 AM 9/24/02 --%
n1= 'Assignment #1'
n2= 'Problem #1'
a=[11,12,13,14;21,22,23,24;31,32,33,34;41,42,43,44]
a(:,1)
a(2,:)
a(:,2:3)
a(2:3,2:3)
a(:,1:2:3)
a(:)
b=[a,[ones(2,2);eye(2)]]
diag(a)
n3='Problem #2'
x=2,y=3,z=4.5
v=[1,1,1;x,y,z;x^2,y^2,z^2]
n4='Problem #3'
b=[ones(10)+(3*eye(10))]
% Problem #4
a=[2,-3;4,0]
b=[3,-1,4;1,2,5]
5*b
a*b(:,3)
% Problem #5
a=[5^3, (3-3i)^3, -(8^(-2/3)); i^5, pi^3, (5.45)^(1/2)]
% Problem #6
a=[1;1;1]
b = [2,3,4]
a*b
b*a
a.*b'
b.*a'
a./b'
a.\b'
%Problem #7
t=[0:0.5:10]';
y=3+t;
plot(t,y)
% Problem #8
a = [15,-2,-6,0;-2,12,-4,-1;-6,-4,19,-9;0,-1,-9,21]
b = [300;0;0;0]
c =det(a)
x = inv(a) * b
c = a*x
% 1. Since det(a) is non zero, a is invertible
% 2. Since a*x = b the solution x = inv(a) * b is correct