MATLAB: Use a for loop to create a script that prints numbers 0 through 10, except 3 and 6

for loopsMATLAB

for i = 0 : 1 : 10
disp(i)
while i == 3 && i == 6
do something
end
end

Best Answer

  • for i = 0 : 1 : 10
    disp(i)
    if i == 3 || i == 6
    printf("Value = %d\n")
    end
    end