MATLAB: Skip a number after every two number in for loop for loop skip numbers formulaMATLAB Hello, I want to execute a for loop from value 1 to 10. but within this range I want to skip number 3, 6 and 9. could you please help with the logic of skipping specific number at regular. Best Answer L=1:10;for k = L(~ismember(L,3:3:L(end))) kend Related SolutionsMATLAB: Converting for loop to while loop for i =1:5 j=1; k=1; while j<=5-i fprintf(' '); j = j+1; end while k<=i fprintf('*'); k = k+1; end fprintf('\n')end MATLAB: Problem of for loop If you mean to sum all the values usefor k=1:10 x(k)=sin(k)endout=sum(x)%or without a for loopk=1:10x=sin(k)out=sum(x) Related QuestionCould you please convert it into a loopHow to keep track of iterate numbers in variable namesN number of 2×2 matricies to diagonal matrixGenerating a number with specific number of times.
Best Answer