%% 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 = isequal(A1,A2,A3)

% The result is logical 0 (false) because isequal does not treat NaN values as equal to each other.
% Copyright 2012 The MathWorks, Inc.