I am attempting to extract a vector element piecewise within a while loop and assign it to the while evaluation variable for test. I am able t do this once before I enter the loop but I cannot do this once in the loop and I get the "Array index is invalid message". Is there a way to conveniently extract the element and assign it to the evaluation variable? I am not a strong coder, clearly, I do not understand something.
Any help would be greatly appreciated.