How to display graphically
1 view (last 30 days)
I want the conditions of an issue to be graphically displayed at each step of the program. For example, in the case of a River crossing puzzle, I want to show which people (variables) are on which side of the river at each step.
Nora Khaled on 22 Nov 2020
Edited: Nora Khaled on 22 Nov 2020
not sure this is what you had in mind ...
axis([-envSize envSize -envSize envSize]);
left=[0 0 1 1 1 1 1];
right= [1 1 0 0 0 0 0 0];
% number of ppl
%random position for ppl
pL = [-(minX + (maxX-minX) .* rand(nL,1)), (minY + (maxY-minY) .* rand(nL,1))]
pR = [(minX + (maxX-minX) .* rand(nR,1)) , (minY + (maxY-minY) .* rand(nR,1))]
the output looks like this