ilarinieminen / SOM-Toolbox

GNU General Public License v2.0
119 stars 56 forks source link

Use 'any' to allow checking of bins vector #19

Closed twocs closed 7 years ago

twocs commented 7 years ago

The value of "bins" is a vector of histogram bin centers. For a correctly formed "bins" that is a vector with multiple values, isnan(bins) returns a vector of boolean values that can't be compared using ||, throwing an error.

To fix this error, I'd remove the isnan check, but I'm assuming that it's there for a reason. By wrapping it with any() the value is false if any bins contain a NaN, but true if "bins" is a vector, as expected.