From: Mariano on
Hi, Maybe you can help me with this expression

P = A.*exp(-B*lambda);

where lambda is a positive real scalar, A and B are both real and
positive vectors of size= 1800x1.
Right now, about 360K calls of P take ~20 secs. Is there any way to
speed it up or is this as good as it gets?
Thanks!


Mariano
From: vortse a on
Perhaps if you have no further need for either A or B, perform an inplace computation, in order to save time from allocating memory to a new variable

>>A=A.*exp(-B.*Lambda);
From: Matt Fetterman on
"vortse a" <sonoffeanor-remove(a)yahoo.com> wrote in message <hh36i3$3pa$1(a)fred.mathworks.com>...
> Perhaps if you have no further need for either A or B, perform an inplace computation, in order to save time from allocating memory to a new variable
>
> >>A=A.*exp(-B.*Lambda);

Also I wonder if you are changing B on every run, otherwise you could save exp(-B.*Lambda)