Files
mql5-skills/skills/mql5/references/docs/06-matrix/0390-matrix-matrix-solves-matrix-solve.md
T
2026-06-23 21:47:51 +08:00

38 lines
740 B
Markdown
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Solve
Solve a linear matrix equation, or system of linear algebraic equations.
```
vector matrix::Solve(
  const vector  b      // ordinate or 'dependent variable' values
   );
```
Parameters
b
[in]  Ordinate or 'dependent variable' values. (Vector of free terms).
Return Value
Vector with solution to the system a * x = b.
Note
If at least one matrix row or column is zero, the system has no solution.
If two or more matrix rows or columns are linearly dependent, the system has no solution.
Example
```
//--- SLAE solution
   vector_x=matrix_a.Solve(vector_b);
//--- check if a * x = b
   result_vector=matrix_a.MatMul(vector_x);
   errors=vector_b.Compare(result_vector,1e-12);
```