%% Members of Set Containing NaN Values
% Create two vectors containing NaN.

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

%
% Determine which elements of A are also in B, as well as their corresponding locations in B.

[Lia,Locb] = ismember(A,B)

% ismember treats NaN values as distinct.
% Copyright 2015 The MathWorks, Inc.