From: Stein on
Ultra late, but incase anybody comes across this by a search (like me). You
can define it as below if you don't want to add the function file.

n=[-5:5]; % -5 < n < 5 (greater than or equal)
x = 2*[(n+2) == 0] - [(n-4) == 0] % x[n] = 2d[n+2] - d[n-4] (d=delta)
stem(n,x) % check result