displaying the radius on the plot

5 次查看(过去 30 天)
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