So I have a vector:
k = 1:100;
And I want to take from it 19 elements that are approximately equally distributed. So I write this:
m = k(1:(99/18):end);
This works fine except for a tiny problem:
Warning: Integer operands are required for colon operator when used as index
m =
1 7 12 18 23 29 34 40 45 51 56 62 67 73 78 84 89 95 100
Now I understand why this is happening, but I would like to get rid of this warning. Is there a “right” way to do this without warning?
source
share