How to inser 10x10 eqaully squares in the same picture

조회 수: 1 (최근 30일)
Mekala balaji
Mekala balaji 2019년 5월 4일
댓글: Walter Roberson 2019년 5월 4일
I have below code to draw cirle to draw a circle, and I want to draw 10x10 squares (of eqaul size) with sum of the sides will be eqaul to cirlce dia.
pos = [2 4 2 2];
rectangle('Position',pos,'Curvature',[1 1])
axis equal
hold on
rectangle('Position',pos,'EdgeColor','r')
  댓글 수: 5
Mekala balaji
Mekala balaji 2019년 5월 4일
In regular grid.
Walter Roberson
Walter Roberson 2019년 5월 4일
The size of one square is min(diff(1:10)) which is 1. That is, to use a square that is D on a side, use D as the increment, like
x_coordinates = first_x + (0:10)*D;

댓글을 달려면 로그인하십시오.

답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by