Effacer les filtres
Effacer les filtres

plotting problem: getting empty graph window

2 vues (au cours des 30 derniers jours)
Zeynep Toprak
Zeynep Toprak le 10 Nov 2020
Modifié(e) : Stephan le 10 Nov 2020
I want to draw this
cos(8*pi*x)/(1+x^2) for x in [-1, 1]
but I get empty graph. How can I correct this?

Réponses (1)

Stephan
Stephan le 10 Nov 2020
fun = @(x) cos(8*pi.*x)./(1+x.^2)
fplot(fun,[-1, 1])
  2 commentaires
Zeynep Toprak
Zeynep Toprak le 10 Nov 2020
thanks a lot
Stephan
Stephan le 10 Nov 2020
Modifié(e) : Stephan le 10 Nov 2020
fplot(fun,[-1, 1],'-.g')
or:
x = linspace(-1,1,500);
y = fun(x);
plot(x,y,'.g')

Connectez-vous pour commenter.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by