Subject: how to generate matrix by existed matrices
From: Stavros Macrakis
Date: Wed, 28 Oct 2009 10:36:36 -0400
Besides addcol and addrow, you may find my email from Oct 6 useful on this
topic:
Let's define some example matrices:
a:matrix([a,b],[c,d]);
[ a b ]
[ ]
[ c d ]
b:matrix([e,f],[g,h]);
[ e f ]
[ ]
[ g h ]
A matrix in Maxima is a list of rows (each of which is a list), so appending
two matrices appends their row-lists, giving:
append(a,b);
[ a b ]
[ ]
[ c d ]
[ ]
[ e f ]
[ ]
[ g h ]
But you wanted to append the column-lists, so you need to map through the
rows:
map(append,a,b);
[ a b e f ]
[ ]
[ c d g h ]
Equivalently:
transpose(append(transpose(a),transpose(b)));
[ a b e f ]
[ ]
[ c d g h ]