function a=gmin(b);
% g=find(b(:)~=NaN);
% a=min(b(g));

%%%%% Modified by jpx %%%%%
g=isnan(b(:));
g=find(~g);
a=min(b(g));
%%%%% Modified by jpx %%%%%
