5.49.27 Append a column to a matrix: border
border takes as argument a matrix A of dimension p*q
and a list b of size p (i.e. nrows(A)=size(b)).
border returns the matrix obtained by appending
tran(b) as last column to the matrix A, therefore:
border(A,b)=tran([op(tran(A)),b])=tran(append(tran(A),b))
Input:
border([[1,2,4],[3,4,5]],[6,7])
Output:
[[1,2,4,6],[3,4,5,7]]
Input:
border([[1,2,3,4],[4,5,6,8],[7,8,9,10]],[1,3,5])
Output:
[[1,2,3,4,1],[4,5,6,8,3],[7,8,9,10,5]]