Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to obtain a square matrix of the diagonal elements and 0 ? #1228

Closed
hunter1992 opened this issue Apr 9, 2023 · 0 comments
Closed

How to obtain a square matrix of the diagonal elements and 0 ? #1228

hunter1992 opened this issue Apr 9, 2023 · 0 comments

Comments

@hunter1992
Copy link

For example, I got a square matrix named A:

$$A = \begin{bmatrix} a_{11}&a_{12}&a_{13}\\ a_{21}&a_{22}&a_{23}\\ a_{31}&a_{32}&a_{33}\\ \end{bmatrix}$$

Now I wanna get a matrix B from A by nalgebra:

$$B = \begin{bmatrix} a_{11}&0&0\\ 0&a_{22}&0\\ 0&0&a_{33}\\ \end{bmatrix}$$

I have checked the document, but didn't find any func works.

NEED HELP~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant