function [dem,N,M] = demean(x)
% [dem,N,M] = demean(x)
N=size(x,1)
M=size(x,2)
for m=1:M
sum=0;
j=0;
for i=1:N
   j=j+1;
   sum=sum+x(i,m);
end
mn=sum/N;
for i=1:N
dem(i,m)=x(i,m)-mn;
end
end
   
      