In Matlab, you can define the delta function as an array of zeros with a single non-zero element at the position corresponding to t = 0.
Here's how to create it:
main.m27 chars2 lines
In this example, I've created a delta function with 11 elements, where the first element is 1 and the rest are zeros.
You can change the length of the array by modifying the second argument of the zeros
function.
gistlibby LogSnag