displaying the radius on the plot

조회 수: 5 (최근 30일)
jeet Mehta
jeet Mehta 2019년 6월 9일
답변: Star Strider 2019년 6월 9일
HI everyone i have 2 cocentric circle which are of radius 1.5 and rafius 2 . i just want to be able to display the radius on to the plot once simulated . How do i do dat ?
Thank you

채택된 답변

Star Strider
Star Strider 2019년 6월 9일
I am not quite certain what you want.
The Code —
t = linspace(0, 2*pi);
r = [1.5; 2]; % Radius
ctr = [0.5; 0.2]; % Circle Center
x = [r*cos(t) + ctr(1)]';
y = [r*sin(t) + ctr(2)]';
figure
plot(x, y)
hold on
plot([1 1]*ctr(1), [1 1]*ctr(2),'+r') % Plot Center
plot([ctr(1) x(20,1)], [ctr(2) y(20,1)],'-b')
plot([ctr(1) x(40,2)], [ctr(2) y(40,2)],'-r')
hold off
axis equal
axis([ -3 3 -3 3])
text(x(20,1), y(20,1), '$R\ =\ 1.5$','Interpreter','latex')
text(x(40,2), y(40,2), '$R\ =\ 2.0$','Interpreter','latex')
The Plot —
displaying the radius on the plot - 2019 06 08.png
This draws the radii and labels them.
Experiment to get the result you want.

추가 답변 (0개)

카테고리

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