MATLAB: IF / ELSE Usage within For loop for Specific Iteration Only

for loopif else statement

When using a FOR LOOP can I do something like when
for i=1:1:15
When i iterates at 9, 10, 12 & 14 ONLY do an additional condition. Is it possible? Can i maybe add in an IF Condition? Would be good if i can sum up al the 4 possibilities within this 1 IF Statement. Thanks!

Best Answer

for i=1:1:15
if ismember(i,[9 10 12 14])
% do
end