Hi,
Let's say I have a matrix NxM , and i have a vector 1xM. the contents of the vector indicates for every column in which row i should put the value '1'.
example – 5×5 matrix A all zeros, and vector V 1×5 = [3 1 1 5 4]. I want to get:
0 1 1 0 0 0 0 0 0 0A = 1 0 0 0 0 0 0 0 0 1 0 0 0 1 0
How can I do that without using loops? (my matrix size is very large)
Thanks
Best Answer