a=input('a='); b=input('b='); x=input('Starting x = '); N=input('Number of iterations = '); recrd=[]; for i=1:N y=a*x+b; x=y; recrd=[recrd; i x]; end recrd