Why won't this plot?
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Serena Simpson
le 18 Sep 2020
Commenté : Star Strider
le 19 Sep 2020
%% Section 1: Initalization of Variables
%increments of x
x = -4:1:-1;
%
%The function we are given
y = x + (1 ./ (x.^2-1));
%% Section 2: Processing
plot(x,y)
axis([-15 15 0 15])
%I want to be able to see the y function appraching the verticle asymptote '-1' from the left but my function wont graph
2 commentaires
Asad (Mehrzad) Khoddam
le 18 Sep 2020
First, use more points:
x = -4:.1:-1;
Then remove the axis limil:
% axis([-15 15 0 15])
Réponse acceptée
Star Strider
le 18 Sep 2020
The problem are the y-axis limits in the axis call.
Comment-out the axis call (as I do here) and you will immediately see the problem.
plot(x,y)
% axis([-15 15 0 15])
.
4 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!