
How to display a plot going to infinity?
13 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I am meant to plot the Dirac Delta function:

my attempt:
x = -30:1:30;
y = zeros(1,numel(x)); %sets all values initially to zero
y(x==0)= inf; % the point corresponding to x=0 is set to inf
plot(x,y,'d')
axis([-40 40 0 inf])

How can I get it to visually show it going up to infinity?
2 commentaires
Réponses (1)
KSSV
le 21 Fév 2018
Modifié(e) : KSSV
le 21 Fév 2018
x = -30:1:30;
y = zeros(1,numel(x)); %sets all values initially to zero
y(x==0)= inf; % the point corresponding to x=0 is set to inf
plot(x,y,'d')
text(-41.,0.65,'~','Fontsize',20)
text(-41.,0.67,'~','Fontsize',20)
text(39,0.65,'~','Fontsize',20)
text(39,0.67,'~','Fontsize',20)
axis([-40 40 0 inf])
Adjust the text positions.....
2 commentaires
Walter Roberson
le 25 Jan 2019
There are a couple of File Exchange contributions for creating plots with broken axes.
Voir également
Catégories
En savoir plus sur Annotations 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!