A <- matrix(c(2, 1, -1,
-3, -1, 2,
-2, 1, 2), 3, 3, byrow=TRUE)
b <- c(8, -11, -3)
matrix2latex(cbind(A,b))
matrix2latex(cbind(A,b), digits = 0)
matrix2latex(cbind(A/2,b), fractions = TRUE)
matrix2latex(A, digits=0, brackets="p", show.size = TRUE)
# character matrices
A <- matrix(paste0('a_', 1:9), 3, 3)
matrix2latex(cbind(A,b))
b <- paste0("\\beta_", 1:3)
matrix2latex(cbind(A,b))
Run the code above in your browser using DataLab