Question: Generation of a random array

To gererate a random initail cofigration -1 or 1

spin = (-1).^(round(rand(N)));

 

for i=1:1000,

 

neighbours = circshift(spin, [ 0 1]) + ...

circshift(spin, [ 0 -1]) + ...

circshift(spin, [ 1 0]) + ...

circshift(spin, [-1 0]);

how to do this in maple?

Please Wait...