function array=sortarray(array)
for i=1:1:length(array(1,:))
         array(i,:)=sort(array(i,:))
end
for i=1:1:length(array(:,1))
         array(:,i)=sort(array(:,i))
end