Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
I have to implement the following equation in matlab.. I am trying to do it using a for-loop but I get an error since the initial value of L=0.
How else can I implement it?
The equation is:
The code I'm using and getting an error:
Code:
for i=1:L
delta = s(k) - lambda_prev(1+i)*(s(k-i))';
end
Make your for loop i=0:L
As long as you aren't calling or assigning to an array element zero, like s(0)... then your code should work.
Additionally, you could shift everything by 1, making the loop run 0 to L, but where ever you have "i", change it to "i+1", so the first time through the loop you'll always have i+1 give you a 1, and not a 0.
Without seeing more of your code, its tough to say which method will work best for your situation.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.