matrix.is_identity() - Pine Script Function
matrix.is_identity()
Section titled “matrix.is_identity()”Overview
Section titled “Overview”The function determines if a matrix is an identity matrix (elements with ones on the main diagonal and zeros elsewhere).
Syntax
Section titled “Syntax”matrix.is_identity(id) → series boolParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| id | matrix<int/float> | Matrix object to test. |
Returns
Section titled “Returns”Returns true if id is an identity matrix, false otherwise.
Remarks
Section titled “Remarks”- Returns false with non-square matrices.