Question

I want to stack columns of a matrix in Maxima.

Example

b3: matrix(
 [1,0,0], 
 [-a21,1,0], 
 [-a31,-a32,1]
);

I wonder how to stack the columns of this matrix. Thanks in advance for your help and time.

Was it helpful?

Solution

Here is an naive way of doing it:

c : transpose( b3 );
transpose( append( c[0], c[1], c[2] ) );

and here is a more general way:

apply(append, map(lambda([r], transpose(b3)[r]), makelist(i,i,3)));

OTHER TIPS

Or even just:

transpose(apply(append,args(transpose(b3))));
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top