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.

Skip to content# MATLAB: The use of the text function.

labelling graphs of the functions

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.

## Best Answer