It's not very clear what you're plotting so it's a little hard to answer your question. Maybe some of the following help.
%New coordinates for B: newB=[23,4];
%Only alter this row and column in "myMatrix" if the value there is zero if myMatrix(newB(1),newB(2))==0 myMatrix(newB(1),newB(2))=1; end