function minX = nanmin(X)
i = find(~isnan(X));
minX = min(X(i));