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.
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!