MAPLE Worksheet Number 11
Linear Algebra:
Elementary Matrix Manipulation
Now we will explore topics from Linear Algebra (stuff covered in MATH 2360 at TTU).
To begin we
will need to load the linear algebra package. The command is
>
with(linalg);
There's lots of stuff here, let's hope we won't have to use it all. The first thing we need to know is how to
enter a given matrix.
One way is to list each row as a vector.
For example to enter the matrix
M =
1
0
1
2
1
0
0
1
1
use the MAPLE command
>
M:=matrix([[1,0,1],[2,1,0],[0,1,1]]);
Another way is to give the rowcolumn size of the matrix and then list all the elements.
For example to
enter the matrix
N=
0
1
2

1
3

2
try the MAPLE command
>
N:=matrix(3,2,[0,1,2,1,3,2]);
In general you can use either command you wish.
You should practice using both to see the benefits of
each.
Now enter the following matrices
:=
P
0
1
1
1
1
0
1
0
1
,
:=
R
1
2
0
1
0
1
1
,and
:=
Q
2
0
0
1
It seems to me the latter method is the easiest to use for entering a one column matrix (column vector).
For example the commands
>
C:=matrix(4,1,[1,2,3,4]);C:=matrix([[1],[2],[3],[4]]);
Define the same 4x1 matrix.
To view a previously defined matrix, say M, try the command
>
M;
This isn't terribly enlightning.
To "see"
M we use the command
>
evalm(M);
I would guess that evalm is short for evaluate the matrix. Next we might want to add two matrices.
Try
adding M and P in the obvious way
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
This is the end of the preview.
Sign up
to
access the rest of the document.
 Spring '08
 McAllister
 Math, Linear Algebra, Algebra, Matrices, Elementary Matrix Manipulation, previously defined matrix

Click to edit the document details