Hi, I was wondering if somebody could comment on my use of array indexing. I have a recursive function which uses some initial conditions passed in. I use it in the following manner.
ic is a long vector. x_i is a double.
This line seems to be taking a lot of execution time, about 50% of the total time Matlab spends in this function (using Profiler). The rest of the code is set of vectorized computations; I believe they are as fast as they can be.
I made one small adjustment and it made it a bit faster.
ic(2:end) = ic(1:end-1);
ic(1) = x_i;
This improved the execution time and these two lines take 40% of the total execution time of the function.
Could anybody suggest any better way of implementing this FIFO array.
Thanks for your time and comments.