help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Vectorize a function that depends on previous function value


From: Francesco Potortì
Subject: Re: Vectorize a function that depends on previous function value
Date: Mon, 19 May 2014 17:36:09 +0200

>> function [a,b] = dynamicalSystmem(data, params, a1, b1)
>>   a = zeros(N,1);
>>   b = zeros(N,1);
>>   a(1) = a1; b(1) = b1;
>>   for n = 2:N
>>     a(n) = a(n-1) + data(n) + b(n-1) + someNonLinearFunction(a(n-1));
>>     b(n) = b(n-1) + someOtherNonlinearFctn(a(n-1));
>>   end
>> end
>>
>> The goal is, to remove that for loop there.... Ah, and yes, the
>> nonLinearFunctions are vectorized.

>I do not think you can vectorize a time dependence relation easily,

If it were a linear dependence, you could have used linear filtering.
For non-linear functions there may be application-specific methods, but
as a non-matematician I too think there is no general method...

-- 
Francesco Potortì (ricercatore)        Voice:  +39.050.621.3058
ISTI - Area della ricerca CNR          Mobile: +39.348.8283.107
via G. Moruzzi 1, I-56124 Pisa         Skype:  wnlabisti
(entrance 20, 1st floor, room C71)     Web:    http://fly.isti.cnr.it



reply via email to

[Prev in Thread] Current Thread [Next in Thread]