This is most basic code to reproduce my problem:
clear all; clc; close;
R = 64;
array_b = zeros(1, 1000);
for i = 1:10000
Running this program does not show any errors. If I put a breakpiunt at the line
and try to view the value of array_b(1,(kk+1)*R:-1:kk*R+1), I get
??? Index exceeds matrix dimensions.
which is what I expect. Size of array_b is (1, 1000) and for kk = 15 (first iteration of the loop), (kk+1)R:-1:kkR+1 = 1024 > 1000, so I should get an error.
But if I run the program normally I don't get an error. Why is that? This is supposed to copy the contents of array_b from lower indices to higher indices, 64 elements at a time. During the first iteration of the loop, if it does not make an error, where do the elements that are supposed to go from 1001 to 1024 go to?