Inserting a circle at specific coordinates

조회 수: 1 (최근 30일)
Rasmus
Rasmus 2014년 2월 19일
편집: Mischa Kim 2014년 2월 19일
I have a group of data, which when plotting gives me a circle. I want to have the circles center to be at (-1,1)in another plot of data.
How do i do this?
I hope someone can help me, thank you :)
  댓글 수: 1
Dishant Arora
Dishant Arora 2014년 2월 19일
Add centre co-ordinates to your x and y data and then plot.

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

채택된 답변

Mischa Kim
Mischa Kim 2014년 2월 19일
편집: Mischa Kim 2014년 2월 19일
Rasmus, for the general case (circle with noise) check out this entry in the File Exchange. The app will give you radius R and the center of the circle (xc,yc). With this data you can then simply
t = linspace(0,2*pi,100);
x_new = R*cos(t) + xc_new;
y_new = R*sin(t) + yc_new;
plot(x_new,y_new)
  댓글 수: 1
Mischa Kim
Mischa Kim 2014년 2월 19일
If your add-on question is about adding the circle to another plot then use
hold on
before the plot commands.

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

추가 답변 (1개)

Rasmus
Rasmus 2014년 2월 19일
sorry I just edited the question, as I forgot to mention something.

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by