필터 지우기
필터 지우기

How to plot y = cos(pi/4)

조회 수: 1 (최근 30일)
James Crowe
James Crowe 2017년 10월 26일
댓글: James Crowe 2017년 10월 26일
How do you plot y = cos(pi/4)? Thank you
  댓글 수: 2
Roger Stafford
Roger Stafford 2017년 10월 26일
That is a constant value, namely 1/sqrt(2). It will not give you something to plot.
James Crowe
James Crowe 2017년 10월 26일
편집: James Crowe 2017년 10월 26일
I need the straight line of it where y = constant. So it should be a straight line at 0.707

댓글을 달려면 로그인하십시오.

채택된 답변

Roger Stafford
Roger Stafford 2017년 10월 26일
Choose upper and lower limits of x as a and b. Choose the desired number of plot points as n.
x = linspace(a,b,n);
y = repmat(cos(pi/4),1,n);
plot(x,y,y-)
  댓글 수: 1
James Crowe
James Crowe 2017년 10월 26일
Thank you so much!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by