Try to compare the data to itself. NaN is not_equal NaN index_of_all_nans=nonzero(not_equal(ravel(data),ravel(data))) __Janko