- Negative indices as mentioned by Kye.
- Even if indices were positive integers, the way you redefine A makes it shrink at each iteration of the loop.
- Even if this is what you want to achieve, the static range coded in the FOR loop is likely not to be adequate as size(A,1) would change at each iteration.
- In your comment to Kye, you have i1=1:size(i,1) which is 1, so this example is probably not what you want to do.
This question is closed. Reopen it to edit or answer.