Here's the basic setup. I am trying to create a while loop that will iterate until a set condition is below a certain tolerance. However, this loop must be generalized for multiple values within the same matrix. An example (simplified from what I'm currently trying to accomplish):
x = [3; 2]
tolerance = [0,0]
iter = 0
while x > tolerance
x = x - 1;
iter = iter + 1;
end
The issue I am facing is that the while loop will exit as soon as 1 of the values in the function is less than the tolerance. What I intend to occur is that the while loop will continue to iterate on both variables until both are below the desired tolerance. I am unable to have two separate loops because the size of the variable I will be iterating upon is not set at 2 values.
Any kind of help would be greatly appreciated.