I would like to have a for loop with 1:25 range but I do not want the for loop to go through number 23 in that range
in another format; I want it like this 1:22 24:25 is it doable this way?
please help
Just to add an alternative:
skip = [23];
for idx = 1:25
if ~any(idx == skip)
%// Your code here
end
end
I think it's more readable than using [1:22 24:25] as your loop variable as you can see clearly and quickly which numbers are being skipped (unless [1:22 24:25] is a variable getting generated elsewhere in which case I would go with that method), it avoids continue which is controversial and it's easy to add other numbers to skip (i.e. skip = [7, 18, 23] etc...)