Here is my sample code, made to work out how to get a while loop to end when any one of three conditions are satisfied.
I want the code to end when n = 100, but it ends at n = 301. How can I get this to end at n=100?
clear all; close all;
n = 0;
R = 0; A = 0; T = 0;
while (R~=1) || (A~=1) || (T~=1)
if n == 100
R = 1;
end
if n == 200
A = 1;
end
if n == 300
T = 1;
end
n=n+1;
end