Modifying elements of a Matrix

Or, more conveniently,

b .= 1.0

Both of your examples needlessly create and allocate an entire new matrix on the right hand side of the assignment.

3 Likes