Hello! I have a matrix of zeros of size [m,n]. I want to set one column in each row (colums will be different for each row). The column numbers are specified in a vector of size [m,1]. How do I implement this without a for loop?
eg. if I had a matrix zeros(2,2) and the vector was [1;2], I would expect a 2×2 identity matrix.
Thanks,
Tanay
Best Answer