MATLAB: For a value 0

homeworkround values

i would like to express the following for i=1:n where 0<n<100
for i =1:16
if i<=4
k=1
elseif i<=8
k=2
elseif i<=12
k=3
elseif i<=16
k=4
end
end
any advice?

Best Answer

for i=1:100
k=floor((i-1)/4)+1
end