CASTI-89 TITANIUM · CALC89
diag(
Returns the main diagonal of a square matrix as a row vector.
Syntax
diag(expr)
- Group
- Matrix
- Arguments
- Takes one square matrix.
- Availability
- Included
- Menu path
- MATH ▸ Matrix ▸ CAS ▸ diag(
Example
| Input | Result |
|---|---|
| diag([1,2;3,4]) | [[1,4]] |
Typing diag([1,2;3,4]) on the home screen and pressing ENTER returns [[1,4]].
Keystrokes on the TI-89 Titanium
2NDMATH4▶×3▼×11ENTER
The same key sequence inserts diag( in Calc89, and the AI tutor shows it step by step on the on-screen keypad.
Related commands
- dim(Returns the dimensions of a matrix as {rows, columns}, or the number of elements of a list.
- dotP(Returns the dot product of two vectors.
- eigVc(Returns the eigenvectors of a square matrix as the columns of a matrix.
- eigVl(Returns the eigenvalues of a square matrix as a list.
- FillReplaces every element of an existing list or matrix variable with the same value.
- identity(Returns the identity matrix of size n by n.
- inverse(Returns the inverse of a square matrix, the same result as raising it to the power −1.
- list▶mat(Converts a list into a matrix, filling it row by row with the given number of columns.