필터 지우기
필터 지우기

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 CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by