solve_lin: Solve a linear system of equations

View source: R/solve.R

solve_linR Documentation

Solve a linear system of equations

Description

Find x in Ax = b. If b not supplied, the inverse of A is returned.

Usage

solve_lin(A, b)

Arguments

A

matrix

b

vector

Examples

if (has_sympy()) {
  A <- matrix_sym(2, 2, "a")
  b <- vector_sym(2, "b")
  # Inverse of A:
  solve_lin(A) %*% A |> simplify()
  # Find x in Ax = b
  x <- solve_lin(A, b)
  A %*% x |> simplify()
}


caracas documentation built on June 22, 2024, 10:59 a.m.