%% Unique Values in Array Containing NaNs
% Define a vector containing NaN.

A = [5 5 NaN NaN];

%
% Find the unique values of A.

C = unique(A)

% unique treats NaN values as distinct.
% Copyright 2012 The MathWorks, Inc.