5.10 How to use matrices in maple?

A:= Matrix( [ [1, 2, 3] , 
              [3, 6, 7] , 
              [5, 6, 9] , 
              [7, 7, 7] 
            ]); 
whattype(A); 
       Matrix 
size:=LinearAlgebra:-Dimension(A); 
     size := 4, 3 
row:=size[1]; 
      row := 4 
col:=size[2]; 
      col := 3
 

You can extract any part of the matrix like this:

B:=A[1..3,2..2];
 
\[ \left [ \begin {array}{c} 2\\ 6\\ 6\end {array} \right ] \]

By Carl Devore http://mathforum.org/kb/message.jspa?messageID=1570678

Maple list and sequence structures are more flexible than Matrices, which are 
highly structured.  A Maple list of lists (called a listlist in Maple) is akin 
to a matrix in some other languages.  Many matrix 
operations can be performed directly on the listlist form, but to do 
serious linear algebra, you should convert to a Matrix.  Of course, it is 
trivial to convert a listlist to Matrix: 
 
LL:= [[1,2], [3,4]]; 
M:= Matrix(LL); 
 
So here is another solution in line with your original wishes.  This is 
"index free", but the table-based solution I gave earlier should be 
faster.  (It is usually considered bad form to repeatedly append to a list or sequence.) 
 
L:= [][]; # Create a NULL sequence 
do 
   line:= readline(file); 
   if line::string then 
      if line contains valid data then 
         Z:= a list of that data; 
         L:= L, Z 
      fi 
   else 
      break 
   fi 
od 
 
A:= Matrix([L]); # Note []: seq -> list.
 

To move move a column into a matrix: Here, I want to copy 2nd column to the 3rd column:

A;

\[ \left [ \begin {array}{ccc} 1&2&3\\ 3&6&7\\ 5&6&9\\ 7&7&7 \end {array} \right ] \]

B:=A[1..row,2];

\[ \left [ \begin {array}{c} 2\\ 6\\ 6\\ 7 \end {array} \right ] \]

 A[1..row,3]:=B: A;

\[ \left [ \begin {array}{ccc} 1&2&2\\ 3&6&6\\ 5&6&6\\ 7&7&7 \end {array} \right ] \]