MATLAB: Using unique.m function on NaNs

isequalwithequalnansMATLABnan~=nanunique sortrows

Can someone please clarify if the result of unique([1 nan; 1 nan],'rows') should be
a) [1 nan; 1 nan] OR b) [1 nan]
Basically, in my version of matlab (2008b), I get a) as the answer and I think it's a bug as the answer should be b). Can someone please confirm if this is a feature or an issue. My mathworks support is limited because of $$ 🙁

Best Answer

No. It's supposed to be a.
By definition nans are not equal to themselves so they're not equal in rows either.
isequal(nan,nan)
or
nan==nan