From: Ubaldo Tiberi on 16 Mar 2010 08:57 Hi everyboby, I have got some time problem with a simulation. I have something like this: X1=[]; Time=[]; for ii=1:50000 Compute T(ii) [X T]=ode45(@(t,x) model(foo1,foo2,....),T(ii),.....) X1=[X1;X] Time=[Time;T] end At each iteration: 1) I compute a time interval for which the function defined in model.m must be integrated 2) I store the value of the state in X1 and of the time in Time. When the number of iterations become "big", the simulation gets very very slow. I was thinking to preallocate the values of Time and X1, but I don't know at each iteration how big will be the vector X and T. How can I speed up my simulations? Thank you, Ubaldo --
|
Pages: 1 Prev: License number plate detection Next: [Debutant]open raw data (sinogram.scn) |