MATLAB: Do the MIN and MAX functions not ignore NaN values inside a matrix of single precision values within MATLAB 6.5 (R13)

ignoreMATLABmaxminnansingle

Why do the MIN and MAX functions not ignore NaN values inside a matrix of single precision values within MATLAB 6.5 (R13)?
The help files for the MIN and MAX functions state that NaN values are ignored. This is not actually the case for vectors of single precision values.
To reproduce this behavior:
a = [8 6 10 NaN 2 4 3];
b = single(a);
min(b),max(b)
This produces the results:
ans =
NaN
ans =
NaN

Best Answer

This has been verified as a bug in MATLAB 6.5 (R13) in the way that the MIN and MAX functions handle vectors of single precision values involving NaN elements.
Currently, to work around this issue, try removing all NaN values from the vector. For example,
a = [8 6 10 NaN 2 4 3];
b = single(a);
c = b;
c(isnan(c)) = [];
min(c),max(c)