% diffusion - plots solns. of the diffusion eqn. % version 1 % Lance Williams % Dept. of Computer Science % Univ. of New Mexico % function q=diffusion(p,l,t) #diffusion(gaussian1d(100,50,5),0.5,400); y_max=max(p); y_min=min(p); n=length(p); q=p; Q=q; g=[1-l,l/2,zeros(1,n-3),l/2]; C=circulant(g); #[X,T]=meshdom(1:n,1:t); axis([1,n,y_min,y_max]); for n=1:(t-1) q=C*q; # Q=[q,Q]; plot(1:length(q),q); end #mesh(T,X,Q');