Back to Linear Algebra
linsolve
Solve linear system Ax = b
Syntax
x = linsolve(A, b)
Description
Solves the linear system A*x = b for x, where A is a square matrix and b is a column vector or matrix.
Parameters
| Name | Description |
|---|---|
| A | Coefficient matrix (n×n) |
| b | Right-hand side vector or matrix |
Returns
Solution vector or matrix x
Examples
Try It
>> A = [1 2; 3 4]; b = [5; 6]; linsolve(A, b)