%% Compare Vectors Containing NaN Values
% Create three vectors containing NaN values.

A1 = [1 NaN NaN];
A2 = [1 NaN NaN];
A3 = [1 NaN NaN];

%
% Compare the vectors for equality.

tf = isequaln(A1,A2,A3)

% The result is logical 1 (true) because isequaln treats the NaN values as equal to each other.
% Copyright 2012 The MathWorks, Inc.