#x+3y+z=9
##画图
f <- function(x,y) {
z <- x + 3*y
}
library(rgl)
open3d()
plot3d(f)
#举例解方程组
Solve the following system of linear equations in five unknowns
x1 + 2x2 + 3x3 + 4x4 + 5x5 = 7
2x1 + x2 + 2x3 + 3x4 + 4x5 = -1
3x1 + 2x2 + x3 + 2x4 + 3x5 = -3
4x1 + 3x2 + 2x3 + x4 + 2x5 = 5
5x1 + 4x2 + 3x3 + 2x4 + x5 = 17
yVec <- c(7,-1,-3,5,17)
AMat <- matrix(0,nr=5, nc=5)
AMat <- abs(col(AMat)-row(AMat))+1
(AMat)%*%yVec