tags:

views:

92

answers:

1

Please refer to the screenshot. I assigned Qswap to a matrix and when I try to view Qswap, it has nothing assigned to it! Help will be appreciated =) alt text

+3  A: 

The swapcol command is from the linalg package, which works with a matrix and/or a vector. Note the lack of capitalization in matrix and vector.

A matrix in Maple is an object which has so-called last_name_eval rules for its evaluation. See the last_name_eval help-page. So when you enter just the name, then all you get back is that name. You can view the underlying array which is assigned to the name using the evalm, eval, or print commands. For example,

restart:
with(linalg):
m:=matrix(2,2,[1,2,3,4]);
qswap:=swapcol(m,1,2);
qswap;
evalm(qswap);

Now, the linalg package is officially deprecated in Maple 13. It's recommended replacement is the LinearAlgebra package (introduced in Maple 6, ten years ago). The LinearAlgebra package is for a Matrix or a Vector (not capitalization). The Matrix and Vector objects do not have last_name_eval, in contrast to matrix and vector. For example,

restart:
with(LinearAlgebra):
m:=Matrix(2,2,[[1,2],[3,4]]);
qswap:=ColumnOperation(m,[1,2]);
qswap;

One last thing. By default only Matrices and Vectors of size <11 get their contents explicitly displayed. You can adjust that with a new cutoff at size 50, say, like this,

interface(rtablesize=50);
acer