line = 1:10;
ind =[3 5];
for ite=1:length(ind)
front = abs(line(ind(ite)) - line(ind(ite)-1));
behind =abs(line(ind(ite)+1) - line(ind(ite)));
if front < behind
line(ind(ite))= line(ind(ite)-1);
else
line(ind(ite))= line(ind(ite)-1);
end
end
--
FROM 49.95.98.*