Suppose I have the following equations:
x + 2y + 3z = 20 2x + 5y + 9z = 100 5x + 7y + 8z = 200
How do I solve these equations for
For clarity, I modified the way the matrices were constructed in the previous answer.
a <- rbind(c(1, 2, 3), c(2, 5, 9), c(5, 7, 8)) b <- c(20, 100, 200) solve(a, b)
In case we need to display fractions:
library(MASS) fractions(solve(a, b))