For Loop Code Something about IIR
1 view (last 30 days)
Show older comments
Can someone help me to loop my code? My code is from python but I struggling to loop it here in Matlab, this code is something about IIR filter
So here is my code:
c5 = 8
c4 = 2
c3 = 7
b0 = 0.05*c5
b1 = 0.03*c4
b2 = 0.02*c3
a1 = 0.5
a2 = 0.5
print(b0,"b0\n",b1,"b1\n",b2,"b2\n",a1,"a1\n",a2,"a2")
k0 = b0
k1 = b1 + k0*a1
k2 = b2 + k1*a1 + k0*a2
k3 = k2*a1 + k1*a2
k4 = k3*a1 + k2*a2
k5 = k4*a1 + k3*a2
k6 = k5*a1 + k4*a2
print("k0 = ", k0)
print("k1 = ", k1)
print("k2 = ", k2)
print("k3 = ", k3)
print("k4 = ", k4)
print("k5 = ", k5)
print("k6 = ", k6)
Thanks <3
7 Comments
Answers (0)
See Also
Categories
Find more on Filter Design in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!