Hi
I am trying to illustrate a square matrix (weights) that represents sqare area that's divided into smaller squares. The values of the 'wiegth' matrix are ones or zeros.
I also have a position vector that has the positions of 2 agents for example within this area (squares are numbered as in first figure).
I want to draw the area while showing the squares that have wights 0f 1, and mark the positions of the agents (something similar to the next figure).
AreaBlocks=36;NoOfAgents=2;wieghts=randi(2,sqrt(AreaBlocks))-1;position=randi(AreaBlocks,[1 NoOfAgents]);% example:
wieghts=[0 0 0 0 0 0; 0 0 0 1 0 0; 0 1 1 1 0 0; 0 0 1 1 1 0; 0 1 1 1 0 0; 0 0 0 0 0 0]; position=[21 17];
I want to create a function that draws this area with adjustable AreaBlocks and NoOfAgents. Any help or ideas on how to do so?
Thank you
Best Answer