liuchlow 没有问题
A <- t(array(c(1:8,10),dim =c(3,3)))
b <- c(1,1,1)
x <- solve(A,b)
x
[1] -1.000000e+00 1.000000e+00 3.330669e-16
B <- solve(A)
B
[,1] [,2] [,3]
[1,] -0.6666667 -1.333333 1
[2,] -0.6666667 3.666667 -2
[3,] 1.0000000 -2.000000 1
建议看看 ?solve
,关于参数 b 有如下解释
This generic function solves the equation a %*% x = b for x, where b can be either a vector or a matrix.
a numeric or complex vector or matrix giving the right-hand side(s) of the linear system. If missing, b is taken to be an identity matrix and solve will return the inverse of a.