I think i have the solution ,
x = 1:5;
eps = 5;
y = zeros(1,1);
fprintf('%10s|%10s|\n----------+----------+\n','n','y(n)');
n| y(n)|
----------+----------+
idx = 1;
while (y < eps)
y = x(idx) + 1;
fprintf('%10d|%10d|\n',idx,y);
idx = idx + 1;
end
1| 2|
2| 3|
3| 4|
4| 5|
Any fresh suggestion for improvement is welcome, and I am open to it.