m=2^10;
x=lcg(1,37,1,m,m);
n=length(x);
plot(x(1:n-1),x(2:n),'.');
title('a=37,c=1,m=1024,period=1024')
xlabel('x(n)')
ylabel('x(n+1)')

figure
x=lcg(1,73,1,m,m);
n=length(x);
plot(x(1:n-1),x(2:n),'.');
title('a=73,c=1,m=1024,period=1024')
xlabel('x(n)')
ylabel('x(n+1)')

disp(['Three dimennsional graph of the same sequence-hit any key'])
pause

figure
plot3(x(1:(n-2)),x(2:(n-1)),x(3:n),'*');
grid on
title('a=37,c=1,m=1024')
xlabel('x(n-2)')
ylabel('x(n-1)')
zlabel('x(n)')
disp(['rotate the graph, then hit any key to continue'])
pause

figure
x=lcg(1,73,1,m,m);
n=length(x);
plot(x(1:n-1),x(2:n),'.');
title('a=73,c=1,m=1024, period=1024')
xlabel('x(n)')
ylabel('x(n+1)')



figure
x=lcg(1,113,1,m,m);
n=length(x);
plot(x(1:n-1),x(2:n),'.');
title('a=113,c=1,m=1024,period=1024')
xlabel('x(n)')
ylabel('x(n+1)')


figure
x=lcg(1,911,1,m,m);
n=length(x);
plot(x(1:n-1),x(2:n),'.');
title('a=m-113,c=1,m=1024,  period=128')
xlabel('x(n)')
ylabel('x(n+1)')

figure
x=lcg(1,397,1,m,m);
n=length(x);
plot(x(1:n-1),x(2:n),'.');
title('a=397,c=1,m=1024,period=1024')
xlabel('x(n)')
ylabel('x(n+1)')


disp(['the same sequence plotted 20 points at a time-slowly holes are filled (hit any key)'])
pause

figure
x=lcg(1,397,1,m,m);
n=length(x);
xlabel('x(n)')
ylabel('x(n+1)')
for k=0:50
    in=(20*k)+(1:20);
plot(x(in),x(1+in),'.');
hold on
title(['a=397,c=1,m=1024    Total number plotted, 20 at a time= ' num2str(20*(k+1))])
pause(1)
end
hold off




disp(['period= 1024'])





