function [V]=SMOOTHER(U,p) % Smooth by colum the matrix U, p times % % [m,n]=size(U); req=p*p+4; V=zeros(m,n); if m>req for q=1:p for j=1:n V(1,j)=U(1,j); V(2,j)=U(2,j); for i=3:(m-2) V(i,j)=(U(i-2,j)+U(i-1,j)+U(i,j)+U(i+1,j)+U(i+2,j))/5; end V(m-1,j)=U(m-1,j); V(m,j)=U(m,j); end U=V; end else error('myApp:argChk', ['More than ', num2str(req),' points needed!']); end end