Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maxima: display list vertically

Tags:

list

maxima

By default, Maxima displays lists "horizontally" :

(%i1) myList : [1,3,7]$
      myList;

(%o1) [1,3,7]

I am working with lists containing very few atoms, but each atom takes up a lot of space when displayed. Therefore it would be more convenient to display those lists vertically. A way to achieve that result would be the following :

(%i1) myList : [1,3,7]$
      transpose(myList);

(%o1) ⎡1⎤
      ⎢3⎥
      ⎣7⎦

I might also want to display two lists vertically, one after the other :

(%i1) myList      : [1,3,7]$
      myOtherList : [6,2,4]$
      print(transpose(myList),transpose(myOtherList);

(%o1) ⎡1⎤ ⎡6⎤
      ⎢3⎥,⎢2⎥
      ⎣7⎦ ⎣4⎥

As you can see I have a working solution. However, it takes a lot of characters to type & read. Hence my question : is there a more elegant way to achieve a similar result ?

like image 310
Gael Lorieul Avatar asked Jul 10 '26 04:07

Gael Lorieul


1 Answers

One option: Define your own myprint that accepts a list of arguments to print, transposes the elements, that are matrices, and then prints the list.

Then you can write

myprint( [ myList, myOtherList ]);
like image 98
soegaard Avatar answered Jul 13 '26 10:07

soegaard