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?
Currently I am doing this:
points = [(1,1), (30, 20), (8,7)]
grid = zeros(n,m);
for i = 1:length(points)
grid(points(i,1),points(i,2))=1;
end
Thanks a lot I'm newbie in matlab and I couldn't find the answer so far.