function [x,y] = SaltosC3_3(nj,np)

% Generates a 2D random walk of M particles in N jumps
% Input:
%   nj : number of jumps
%   np : number of particles
% Output:
%   x(nj,np) : particle positions in Ang
% J.M.Soler, Apr.2015

% Set system parameters
d = 2.55;   % lattice parameter in Ang
dx = [ +1,  0, -1,  0, 0 ]*d;    % transition x displacements
dy = [  0, +1,  0, -1, 0 ]*d;    % and y displacements
nd = numel(dx);

x = zeros(nj,np);
y = x;
for ij = 1:nj
    k = randi(nd,1,np);
    x(ij+1,:) = x(ij,:)+dx(k);
    y(ij+1,:) = y(ij,:)+dy(k);
end
x = x(2:nj+1,:);
y = y(2:nj+1,:);

end