dakster
Chemical
- Oct 15, 2009
- 1
I am a Matlab newbie, and have been going through a Matlab guide as well as the help menus for about a week now, but I can’t figure out how to write my first real script. I have a 1024x1 vector (actually I have a couple hundred of these), and I want to create a new vector wherein each element is a function of the preceding element and the corresponding element in the original vector. Specifically:
New Vector Element (i) = 0.55*Orig Vector Element (i-1) + 0.45*New Vector Element (i-1)
I know I need a ‘for’ loop, but I guess the thing I’m stuck on is how to tell Matlab to use the preceding value in the vector being populated. Help?
New Vector Element (i) = 0.55*Orig Vector Element (i-1) + 0.45*New Vector Element (i-1)
I know I need a ‘for’ loop, but I guess the thing I’m stuck on is how to tell Matlab to use the preceding value in the vector being populated. Help?