Effacer les filtres
Effacer les filtres

How to plot y = cos(pi/4)

1 vue (au cours des 30 derniers jours)
James Crowe
James Crowe le 26 Oct 2017
Commenté : James Crowe le 26 Oct 2017
How do you plot y = cos(pi/4)? Thank you
  2 commentaires
Roger Stafford
Roger Stafford le 26 Oct 2017
That is a constant value, namely 1/sqrt(2). It will not give you something to plot.
James Crowe
James Crowe le 26 Oct 2017
Modifié(e) : James Crowe le 26 Oct 2017
I need the straight line of it where y = constant. So it should be a straight line at 0.707

Connectez-vous pour commenter.

Réponse acceptée

Roger Stafford
Roger Stafford le 26 Oct 2017
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 commentaire
James Crowe
James Crowe le 26 Oct 2017
Thank you so much!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Line Plots dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by