Click here to Skip to main content
15,897,226 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi i have an array x=[ 1 11 21 31 41 51 61 71 81 91]
i would like to create an impulse function of a=[0 1 0 0 0 0 0 0 0 0 0 1 0 0 ....]
my script is as follows

impfunc= zeros(1,max(a)
for n=1 : max(a)
if n==a
x(n)=1
end
end

but what i get is just impfunc = [ 0 0 0 0....]
any idea why it isnt working?
Posted
Comments
Sergey Alexandrovich Kryukov 9-Mar-14 20:08pm    
How this function is inferred from your data, why?
Do you mean approximation of delta-function? something else? if you do, are you familiar with the theory of generalization functions?
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900