How to plot y = cos(pi/4)

1 次查看(过去 30 天)
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-)

更多回答(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