Announcement: All noncommercial projects registered to use Earth Engine before
April 15, 2025 must
verify noncommercial eligibility to maintain Earth Engine access.
ee.Array.matrixToDiag
Stay organized with collections
Save and categorize content based on your preferences.
Computes a square diagonal matrix from a single column matrix.
Usage | Returns | Array.matrixToDiag() | Array |
Argument | Type | Details | this: input | Array | The input array. |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-10-06 UTC.
[null,null,["Last updated 2023-10-06 UTC."],[[["\u003cp\u003e\u003ccode\u003eArray.matrixToDiag()\u003c/code\u003e constructs a square diagonal matrix using elements from a single-column input array.\u003c/p\u003e\n"],["\u003cp\u003eThe function takes an array as input and positions its elements along the diagonal of a new, square matrix, with all off-diagonal elements set to zero.\u003c/p\u003e\n"],["\u003cp\u003eThe resulting diagonal matrix is returned as a new array.\u003c/p\u003e\n"]]],["Transforms a single column matrix into a square diagonal matrix. The input is a one-dimensional array, and the function returns a new array representing the square diagonal matrix. The `matrixToDiag()` method, when applied to the input array, performs this conversion. The input array serves as the diagonal elements of the resulting square matrix.\n"],null,["# ee.Array.matrixToDiag\n\nComputes a square diagonal matrix from a single column matrix.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|------------------------|---------|\n| Array.matrixToDiag`()` | Array |\n\n| Argument | Type | Details |\n|---------------|-------|------------------|\n| this: `input` | Array | The input array. |"]]