% This is a 1D walk, centered at x=0, the input is
% the number of steps N

clear, close all
N = input('enter the number of steps \n')
t = linspace(0,1,N+1)';                       

runsum = [0; cumsum(2*(rand(N,1)>0.5)-1)];  

plot(t,runsum);          % plot the path                        
grid
xlabel('steps')
ylabel('X')
title('1D Random Walk')

