MATLAB: Multiples of 5

multiples

Hi, ive got an array of numbers and i want to delete the array values whose index is a multiple of 5. How can i do this?

Best Answer

for K = numel(YourArray): -1 : 1
if (K / 5) == fix(K / 5)
YourArray(K) = [];
end
end
There are definitely easier ways, but your question sounds like an assignment.
Related Question