%% Union of Vectors Containing NaNs
% Define two vectors containing NaN.

A = [5 NaN 1]; 
B = [4 NaN NaN];

%
% Find the union of vectors A and B.

C = union(A,B)

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