Hi, I have a quick question. Is it possible to write multiple logical conditions in if statement like this;
if (s < (3 * a + b) * 0.25) || (s > b) ||... (mflag) && (abs(s-b) >= (abs(b-c) * 0.5)) ||... (~mflag) && (abs(s-b) >= (c-d) * 0.5) ||... (mflag) && (abs(b-c) < tol) ||... (~mflag) && (abs(c-d) < tol) % bisection method
s = (a+b)*0.5; mflag = true; else mflag = false; end
Best Answer