function y=unitstep(a);
y=sign(a+eps)/2;


Open Matlab .m file and paste the code in it
save the .m file, by default it will save by its name 'unitstep'
call this function from main code file by its name 'unitstep'
e.g
n=[-5:5]
y=unitstep(n)

Categories:

Leave a Reply