Here's my code:
N = 1:999;
for i = N
if rem(i,3) == 0 || rem(i,5) == 0
v(i,1) = i
end
end
Te problem is that I get an Array with some zeros in, but I just want an an arraywith the values comforming to my conditions.
How can I fix it?
Thank you!
N=1:999;thenv=(rem(N,3)==0)|(rem(N,5)==0);. Is that what you want? Or are you wanting:v= N( (rem(N,3)==0) | (rem(N,5)==0) );