the use of the text function.

1 回表示 (過去 30 日間)
metin yilmaz
metin yilmaz 2020 年 11 月 9 日
回答済み: Star Strider 2020 年 11 月 9 日
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.

採用された回答

Star Strider
Star Strider 2020 年 11 月 9 日
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.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by