Date: Nov 22, 2012 7:47 AM
Author: dwi
Subject: sum of exponentials

I have a matrix whose data are interrupted by sequences of zeros. I need every time that there's a zero value to substitute it with a sum of exponentials using the previous data, eg:
x=[x1 x2 x3 0 0 0 x7 0 0]
When i find the first zero in the element x4 I want:
However, when I find the second zero value I need to calculate the same expression but without using the previous recalculated values. That is,
and for x8 I will use only the values in x7,x3,x2,x1 and then x8=x9 etc
And all this for a 180000-length data.
Any ideas on how to do this?
Thanks in advance