MATLAB: School Project

guihomeworkplotting

Hi I'm doing a school project who's end goal is to take randomly placed 'agents' and eventually get them to follow each other in a circle at constant velocity. I've been running a GUI to implement it using vectors to describe the 'agents' (I have two 1×10 vectos, x and y) each (x(i),y(i)) pair describes an agent and I use scatter(x,y) to plot it. I was wondering if there was a simple way to ensure that the 'agents stay within a square area instead of wandering anywhere. Ideally I would like then to wrap around to the other side of the plot.

Best Answer

doc axis
Specifically
axis([0 50 0 50])
Related Question