Matlab For Loop With Two Pointers