Everybody is told to exploit vectorised programmes such as MATLAB and use indexing instead of a for loop.
for e.g, in MATLAB, rather than setting all the element of a matrix to 0 in a double for loop, I could use M[1:N,1:N]=0;
.
My question relates to whether this works sequentially? i.e, if I have some row vector v
of size N
, and I execute the following line
v[1:N-1]=v[2:N]
Then will updated values be used throughout, or does it take a "snapshot" of the vector, and paste that into the vector again in a shifted index?
I'd like it to do this sequentialy so that the values are updated from the bottom first and then used again for values above etc