Which is the difference between `min` and `nanmin`; `max` and `nanmax` in Matlab?
matlab
Solution
`nanmin` just calls `min`:
[varargout{1:nargout}]=min(varargin{:});
Similarly for `nanmax`. That's it!
In some past release, the built-in `min` and `max` were updated with the same functionality, ignoring `NaN`, and the toolboxes just started pointing to them instead of maintaining their own implementations. Just use `max` and `min`, unless you are working on special types that might have their own implementations of these functions.
Problem
Matlab describes `nanmin` and `nanmax` like this: `NANMIN` Minimum value, ignoring `NaN`s. `NANMAX` Maximum value, ignoring `NaN`s. But in fact, `min` and `max` ignore `NaN`s too. Which should I use then? According to my tests, `nanmin` and `nanmax` are faster. Is it always like this?