Hello
I have a matrix that contains rectangles(squares in this case), for example:
A=[-5 -4.5 1.5 2; -5 -4.5 2 2.5; -5 -4.5 2.5 3; -4.5 -4 1.5 2; -4.5 -4 2 2.5; -4.5 -4 2.5 3];for i=1:6 rectangle('Position',[A(i,1) A(i,3) 0.5 0.5]); hold on;endhold on;axis([-10 10 -10 10])
Each row contains ( ) coordinates.
So in this case the result matrix should contain 12 rows, each represents 1 point, like:
-5 1.5-5 2-5 2.5-5 3-4.5 1.5-4.5 2-4.5 2.5-4.5 3-4 1.5-4 2-4 2.5-4 3
The rectangles are not guranteed to form another rectangle, a more realistic set of rectangles:
Best Answer