Home Difference equation solve with dirac function and 2 condition
Reply: 0

Difference equation solve with dirac function and 2 condition

user501
1#
user501 Published in May 24, 2018, 11:25 pm

I have this difference equation and need to plot in matlab

y[n+3]+8y[n+2]+3y[n]=dirac[n]
y[0]=9 y[1]=23 y[2]=7

since i cant indicate 0 in matlab I use to write like this

y = zeros(1, 1009);  % Pre-allocate the range
y(1) = 9;
y(2) = 23;
y(3) = 7;
for n = 1:1006
  y(n+3) = (dirac(n) - 8*y(n+2) - 3*y(n));
end
u = 1:1009;
stem(u,y)

however I think the result i got is totally wrong. Am I doing that right? plot image

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.303797 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO