フィルターのクリア

how to mention function on plot?

2 ビュー (過去 30 日間)
rising falcon
rising falcon 2015 年 10 月 11 日
コメント済み: Star Strider 2015 年 10 月 12 日
x=-pi:pi
y1=sin(x)
y2=cos(x)
plot(x,y1,x,y2)
how can we mention sin and cosine function on plot?

採用された回答

Star Strider
Star Strider 2015 年 10 月 11 日
One option is to use the legend function:
x=-pi:0.1:pi;
y1=sin(x);
y2=cos(x);
plot(x,y1,x,y2)
legend('sin(x)', 'cos(x)', 'Location','NW')
There are other options using the text function if you want to display different text labels.
  3 件のコメント
rising falcon
rising falcon 2015 年 10 月 12 日
thank you.this is helpfull answer
Star Strider
Star Strider 2015 年 10 月 12 日
My pleasure.

サインインしてコメントする。

その他の回答 (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