Hello there! I’m quite new to Julia and facing following issue: assume that we have a matrix:
mat = [1 2 3 4; 2 3 4 5]
and I want to manipulate a single value from a part of the matrix like this:
mat[1:3,1:3][1] = 2
then Julia would create a view and not modify the value in my original matrix mat. Up until now I worked around like this:
temporaryMat = mat[1:3,1:3] => temporaryMat[1] = 2 => mat[1:3,1:3] = temporaryMat.
I am well aware, that in this case I could have just manipulated the first value of our original mat. However I am currently working with a three-dimensional Matrix and I want to manipulate individual values.
I find this Solution to be rather inelegant.
So my question:
is there a way to achieve this with only one command?
I am really looking forward to an answer and thank you all in advance.