Draw angle on a MATLAB figure

40 visualizaciones (últimos 30 días)
vitor oliveira
vitor oliveira el 8 de Feb. de 2021
Respondida: Alan Stevens el 9 de Feb. de 2021
I want to be able to select a random point on a graph, and then draw a dotted line that goes from the origin to that point, and then a dotted line that goes from that point straight down towards the x-axis, and then this is the part I do not know how to do... I want to draw that little arc symbol with a greek letter indicating the angle that the first line makes with the x-axis. How do I do that?
Something similar to that little green arc, with a greek letter right next to it. Thank you!

Respuestas (1)

Alan Stevens
Alan Stevens el 9 de Feb. de 2021
Something like this:
x = [0 1]; y = [0 1.5];
theta = atan(y(2)/x(2));
th = 0:1/360:theta; r = 0.1;
xx = r*cos(th); yy = r*sin(th);
plot(x,y,xx,yy),grid
axis([0 2 0 2])
text(r,r,'\theta')

Categorías

Más información sobre Labels and Annotations en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by