How can I change the values of multiple points in a matrix?

You can do this using the function SUB2IND to convert your pairs of subscripts into a linear index:

mtx(sub2ind(size(mtx),co_ords(1,:),co_ords(2,:))) = 0;

Leave a Comment