logical operation on a varable x
1 visualizzazione (ultimi 30 giorni)
Star Strider il 3 Lug 2015
Taking a wild guess:
for k1 = 1:20
if (k1 == 1) | (k1 == 20)
% Do Something
If k1 is 1 or 20, the loop continues to the next iteration without doing anything after the if block. Otherwise, it continues to do whatever is in the loop.
Hugo il 3 Lug 2015
Is this what you are looking for?
for j = 1:20
if j==1 || j==20, continue; end
This executes everything after the if except when j is 1 or 20.
Joep il 3 Lug 2015
You mean something like this because your question is not clear
A test you can see it is only true on 1 and 20