Julia Programming Language
How to assign the diagonal elements of part of matrix to a value?
General Usage
question
,
matrices
Seif_Shebl
October 22, 2021, 11:46pm
2
You can simply do:
aa[diagind(aa)[5:7]] .= 1
5 Likes
show post in topic
Related topics
Topic
Replies
Views
Activity
Vectorized variable assignment (assign matrix off diagonal values)
New to Julia
linearalgebra
4
2088
October 17, 2018
How to query elements in a matrix diagonal to a given point
Numerics
linearalgebra
8
5977
May 11, 2020
Change the diagonal of an AbstractMatrix in place
General Usage
linearalgebra
,
memory-allocation
2
570
August 29, 2021
Off diagonal elements of Matrix
General Usage
14
5146
June 12, 2020
Efficiently updating values in a sparse diagonal matrix
General Usage
2
758
August 9, 2018