Beruflich Dokumente
Kultur Dokumente
Department of Mathematics
MA1101R Laboratory 1
Semester II 2014/15
Activity 1
Aim: To familiarize with basic MATLAB commands (see Laboratory 0 Worksheet) that
performs simple matrix operations.
Enter the following statements in the MATLAB command window in sequence (this
means that you hit Enter after each entering each command) and observe what happens.
Make sure you understand why you are observing what you see.
x=[1 2 3]
b=[1;
2;
3]
B=ansb
Ax
Ax
Next, enter the appropriate commands (again in sequence) in the MATLAB command
window that allows you to do the following.
Change the display format to format short.
1 3
4
3 1 0
Activity 2
Aim: To work with matrices and recall the properties of the inverse and transpose of sums
and products of matrices. (Refer to Introduction paragraph 3(B).)
Input the following two matrices
A =
7 2 0 2
3
1 0
1
2
0 1
0
16 3 0 2
and
B =
2
2
2
1
5
17 2
6 15 1
6
19 2
2 6
0
(ii) Compute (B 2 )1 and (B 1 )2 . Are these matrices equal? Is this relation true for any
invertible matrix B?
True for any invertible matrix
(iv) Compute the products (AB)T , AT B T and B T AT . What is the relation between
these matrices?
(AB)T = BT AT
(vi) Compute (AT )1 and (A1 )T . Are these matrices equal? Is this relation true for any
invertible matrix A?
True for any invertible matrix
c1
a2 x + b 2 y
c2
a3 x + b 3 y
c3
(1)
For real values of ai , bi and ci , the graphs of these equations are lines in a two dimensional
(x, y) coordinate system. Refer to Discussion 1.1.11 of the textbook.
1. Execute the command plotline.
2. Enter three (different) equations using numbers from the set {4, 3, 2, 1, 1, 2, 3, 4}
for ai , bi , ci to form three lines such that
(i) the system has no solutions.
E.g. x + y = 1, 2x + y = 2, 3x + 2y = 1
(ii) the system has a unique solution.
E.g. x + y = 1, 2x + y = 2, 3x + 2y = 3 (Third equation can be any linear
combination of the first two.)
(iii) the system has infinitely many solutions.
E.g. x + y = 1, 2x + 2y = 2, 3x + 3y = 3. (All three equations must be scalar
multiples of each other.)
3. Repeat part 2 with ci = 0 for all equations. How many possible cases are there?
The three lines must either coincide or intersect at one point. This is because homogeneous systems always has the trivial solution.
2. One plane
(i) Enter (only) one equation ax + by + cz = d such that a, b, c are all non-zero.
E.g. x + 2y + 3z = 4.
(ii) Enter one equation with a, b non-zero but c = 0. Is the graph a line or a plane?
(Why?)
E.g. x + 2y = 0. This is a plane. (Although there are only two unknowns in
the equation, the unknown z still exists (with zero coefficient.) This is because
we are in the 3-D context.)
(iii) Enter one equation with a non-zero but b, c = 0. Is the graph a line or a plane
or a point? (Why?)
E.g. x = 0. This is still a plane. (See explanation in (ii).)
3. Two planes
(i) Enter two (different) equations to form two planes which (i) coincide; (ii) are
parallel but not coincide; (iii) intersect at a line.
E.g. (i) x + y + z = 1, 2x + 2y + 2z = 2.
(ii) x + y + z = 1, x + y + z = 2.
(iii) x + y + z = 1, 1x 2y + z = 2.
(ii) In each case, how many solutions does the system of two equations that you
entered have?
(i) infinitely many; (ii) none; (iii) infinitely many.
(iii) Is it possible for a system of two equations (in 3 variables) to have a unique
solution?
No. Two planes either do not intersect (which correspond to no solution) or
intersect at at least a line (which correspond to infinitely many solutions.)
4. Three planes
(i) Enter a system of three equations ax + by + cz = d such that the first equation
has a, b, c all non-zero; second one has a = 0 and b, c non-zero; third one has
a, b = 0 and c non-zero. No matter what your system is, the three planes always
intersect at a single point. Why?
E.g. x + y + z = 1, y + z = 2, z = 3. This system is in row echelon form and can
5