Previous Up Next

2.42.22  Make a matrix from two matrices : semi_augment

semi_augment concat two matrices with the same number of columns.
Input :

semi_augment([[3,4],[2,1],[0,1]],[[1,2],[4,5]])

Output :

[[3,4],[2,1],[0,1],[1,2],[4,5]]

Input :

semi_augment([[3,4,2]],[[1,2,4]])

Output :

[[3,4,2],[1,2,4]]

Note the difference with concat.
Input :

concat([[3,4,2]],[[1,2,4]]

Output :

[[3,4,2,1,2,4]]

Indeed, when the two matrix A and B have the same dimension, concat makes a matrix with the same number of rows than A and B by gluing them side by side.
Input :

concat([[3,4],[2,1],[0,1]],[[1,2],[4,5]]

Output :

[[3,4],[2,1],[0,1],[1,2],[4,5]]

but :

concat([[3,4],[2,1]],[[1,2],[4,5]]

Output :

[[3,4,1,2],[2,1,4,5]]

Previous Up Next