I have a 2D vector which contains the coordinates which I want to represent as True or one in a matrix with dimensions nxm. Can I build this matrix without a loop?
I recommend using a sparse matrix if the number of coordinates (length(points)) is much smaller (<10%) than n*m. This will make better use of memory and save you time.
points=[1,30,8;1,20,7];
grid = sparse(points(1,:), points(2,:), 1, n ,m);