# # Need to install: # # sudo apt-get install r-cran-rgl # # to get the following to work. # if( !require('matlib') ){ install.packages('matlib', dependencies=TRUE, repos='http://cran.rstudio.com/') } library(matlib) # Problem 10: # A = matrix(c(1, 4, -2, 3), nrow=2, ncol=2, byrow=TRUE) print(echelon(cbind(A, diag(2)))) #, verbose=TRUE, fractions=TRUE) # Problem 11: # A = matrix(c(3, -1, 6, 2), nrow=2, ncol=2, byrow=TRUE) print(echelon(cbind(A, diag(2)), fractions=TRUE)) # Problem 12: # A = matrix(c(1, 2, 3, 2, 4, 5, 3, 5, 6), nrow=3, ncol=3, byrow=TRUE) print(echelon(cbind(A, diag(3)))) #, verbose=TRUE, fractions=TRUE) # Problem 13: # A = matrix(c(1, 1, -1, 2, -1, 1, 1, 1, 2), nrow=3, ncol=3, byrow=TRUE) print(echelon(cbind(A, diag(3)))) #, verbose=TRUE, fractions=TRUE) # Problem 14: # A = matrix(c(1, 2, 1, -2, 1, 8, 1, -2, -7), nrow=3, ncol=3, byrow=TRUE) print(echelon(cbind(A, diag(3)))) #, verbose=TRUE, fractions=TRUE) # Problem 15: # A = matrix(c(2, 1, 0, 0, 2, 1, 0, 0, 2), nrow=3, ncol=3, byrow=TRUE) print(echelon(cbind(A, diag(3)))) #, verbose=TRUE, fractions=TRUE) # Problem 16: # A = matrix(c(1, -1, -1, 2, 1, 0, 3, -2, 1), nrow=3, ncol=3, byrow=TRUE) print(echelon(cbind(A, diag(3)))) #, verbose=TRUE, fractions=TRUE) # Problem 17: # A = matrix(c(2, 3, 1, -1, 2, 1, 4, -1, -1), nrow=3, ncol=3, byrow=TRUE) print(echelon(cbind(A, diag(3)))) #, verbose=TRUE, fractions=TRUE) # Problem 18: # A = matrix(c(1, 0, 0, -1, 0, -1, 1, 0, -1, 0, 1, 0, 0, 1, -1, 1), nrow=4, ncol=4, byrow=TRUE) print(echelon(cbind(A, diag(4)))) #, verbose=TRUE, fractions=TRUE) # Problem 19: # A = matrix(c(1, -1, 2, 0, -1, 2, -4, 2, 1, 0, 1, 3, -2, 2, 0, -1), nrow=4, ncol=4, byrow=TRUE) print(echelon(cbind(A, diag(4)))) #, verbose=TRUE, fractions=TRUE)