p = {{1, 0, 0}, {0, 1, 0}, {0, 1, 0}};
p[[All, 3]][[1 ;; 2]] = {1, 1};
p
I want to replace the first two elements of the third column of a 3x3 identity matrix.
The above code does not work. I get a depth-error message.
Set::partd: Part specification is longer than depth of object
I am confused because the following code is functional.
p[[All, 3]][[1 ;; 2]]
p[[1 ;; 2, 3]] = {1, 1}
? $\endgroup$