How can I create this figure?

조회 수: 2 (최근 30일)
Zeinab Ahmadi93
Zeinab Ahmadi93 2017년 6월 29일
댓글: Zeinab Ahmadi93 2017년 6월 29일
Hi everybody I want to write codes that create Concentric Circles like this figure(first.png),please help me. Actually these circles are path for a sensor node which is equipped with GPS(which is called beacon node), this sensor node traverses the network on these paths in order to help normal nodes to assume their position(coordinates). First I want to create this path and then move this beacon node on these paths(The red stars are beacon points).I have attached the figures. Thanks in advance.

채택된 답변

KSSV
KSSV 2017년 6월 29일
r0 = 0 ; dr = 0.2 ; r1 = 1. ;
r = r0:dr:r1;
th = linspace(0,2*pi) ;
figure
hold on
axis equal
for i = 1:length(r)
x = r(i)*cos(th) ;
y = r(i)*sin(th) ;
plot(x,y) ;
end
  댓글 수: 1
Zeinab Ahmadi93
Zeinab Ahmadi93 2017년 6월 29일
Thanks dear KSSV... :) I have seen the codes like this but the problem is that I don't know how to change the ranges to match my desirable figure and as you can see there is a line which connect the three circles... I don't know how to create them:(

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 WSNs에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by