Skip to content
Permalink
a5a5f364e5
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
19 lines (11 sloc) 292 Bytes
% function node = siteperc(N,p)
% makes 2D lattice site percolation with occupancy p
%
function node = siteperc(N,p)
node = make2Dlattice(N,N);
prob = 1 - p;
Del = randintexc(floor(prob*N^2),N^2);
dnum = length(Del);
for loop = 1:dnum
node = subnode(Del(loop),node);
end