![displaying the radius on the plot - 2019 06 08.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/223693/displaying%20the%20radius%20on%20the%20plot%20-%202019%2006%2008.png)
displaying the radius on the plot
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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
0 Commenti
Risposta accettata
Star Strider
il 9 Giu 2019
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](https://www.mathworks.com/matlabcentral/answers/uploaded_files/223693/displaying%20the%20radius%20on%20the%20plot%20-%202019%2006%2008.png)
This draws the radii and labels them.
Experiment to get the result you want.
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su 2-D and 3-D Plots in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!