开发者

Maple 13 variable assignment does not work

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 =)

Maple 13 variable assignment does not work


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);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜