if (has_sympy()) {
A <- matrix_sym(2, 2, "a")
b <- vector_sym(2, "b")
# Inverse of A:
solve(A)
inv(A)
solve(A) %*% A |> simplify()
# Find x in Ax = b
x <- solve(A, b)
A %*% x |> simplify()
solve(A, c(2, 1)) |> simplify()
}
Run the code above in your browser using DataLab