Prev: How to send a specific windows message to a specific figure (i.e. keypress)
Next: modulation of .txt, .wav format files
From: Mariano on 25 Dec 2009 11:33 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 25 Dec 2009 15:16 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 25 Dec 2009 15:27
"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) |