How Define Delta Function
11 views (last 30 days)
Kutlu Yigitturk on 24 Mar 2021
I have a problem about calculating with Delta Function. I am trying write matlab code for these function.
I wrote the following code for this function.
n = -5:1:7;
x = delta(n+1) - delta(n) + unit(n+1) - unit(n-2);
axis([-6 8 -1.5 1.5])
But I am getting the following error.
I don't now how can ı write the delta function in this way ,
function y = unit(x);
y = zeros(size(x));
y(x>0) = 1;
Can you help me write the delta function as the 'unit' function you see above? Thank you for your helping.