I wanted to create a loop until a certain condition is met, for example lets say I have constant x, that is included in equations A and B. Error is A-B. I want the x to keep changing until Error < 1E-3. How can I do this?
A = x + 1.5;
B = x^2 + 1;
Error = A-B;
I dont even know where to start, should I be using a for loop or a while loop?
Thanks in advance!