function [x y] = DiffusionMem(N,membrane,permeability) % N is a positive integer. % Simulates a 2D Diffusion with semipermeable membrane % x and y are row vectors with the property that (x(k),y(k)) is the % location of the token after N Time. %Membrane is where the molcules cannot cross % Initializations... k = 0; xc = 0; yc = 0; % In general, (xc,yc) is the location after N time. while k