Overlapping points

1 次查看(过去 30 天)
Avni
Avni 2012-6-13
Hello
I was wondering if there was a way to prevent points from overlapping. I have generated a [200 by 50] matrix and at a certain point the points will all match up. Is there a way to create a code in matlab that will prevent the points from overlapping when plotting. For instance at step one there is a point A at 23,4 and another point B is 23,5. At step two point A is still 23,4 and point B becomes 23,4 as well. Is there a way to say that at location 23,4, there is already a point and therefore point B should just stay at 23,5.
Thanks

回答(1 个)

Rob Campbell
Rob Campbell 2012-6-13
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

类别

Help CenterFile Exchange 中查找有关 Annotations 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by