RosettaCodeData/Task/Array-concatenation/Maxima/array-concatenation.maxima

24 lines
469 B
Plaintext

u: [1, 2, 3, 4]$
v: [5, 6, 7, 8, 9, 10]$
append(u, v);
/* [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] */
/* There are also functions for matrices */
a: matrix([6, 1, 8],
[7, 5, 3],
[2, 9, 4])$
addcol(a, ident(3));
/* matrix([6, 1, 8, 1, 0, 0],
[7, 5, 3, 0, 1, 0],
[2, 9, 4, 0, 0, 1]) */
addrow(a, ident(3));
/* matrix([6, 1, 8],
[7, 5, 3],
[2, 9, 4],
[1, 0, 0],
[0, 1, 0],
[0, 0, 1]) */