I am trying to reproduce the Dirac Delta function: 

![Dirac Delta Function](https://i.stack.imgur.com/f2rbP.png)

my code:

```
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])

```

My code produces: 

![My figure](https://i.stack.imgur.com/7KZZu.png)