Can I name the functions using the function text, or any other, in one step?
x:0:pi/40:4*pi; plotyy(x, sin(x), x, cos(2*x))
This does not work: text(x, sin(x), 'sin', x, cos(2*x), 'cos')
Thank you.

 Respuesta aceptada

Star Strider
Star Strider el 9 de Nov. de 2020

0 votos

This does work, however you may want to reconsdier how you want it to appear:
x = 0:pi/40:4*pi;
figure
plotyy(x, sin(x), x, cos(2*x))
text(x, sin(x), 'sin')
text(x, cos(2*x), 'cos')
Note that I edited the ‘x’ assignment to produce a valid vector.

Más respuestas (0)

Categorías

Más información sobre Labels and Annotations en Centro de ayuda y File Exchange.

Preguntada:

el 9 de Nov. de 2020

Respondida:

el 9 de Nov. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by