%% Determine Unique Rows
% By default, uniquetol looks for unique elements that are within tolerance, but it also can find unique rows of a matrix that are within tolerance.
% Create a numeric matrix, A. Obtain a second matrix, B, by transforming and untransforming A. This transformation introduces round-off differences to B.

A = [0.05 0.11 0.18; 0.18 0.21 0.29; 0.34 0.36 0.41; 0.46 0.52 0.76];
B = log10(10.^A);

%
% Use unique to find the unique rows in A and B. The unique function performs exact comparisons and determines that all of the rows in the concatenated matrix [A;B] are unique, even though some of the rows differ by only a small amount.

unique([A;B],'rows')

%
% Use uniquetol to find the unique rows. uniquetol treats rows that are within tolerance as equal.

uniquetol([A;B],'ByRows',true)

% Copyright 2015 The MathWorks, Inc.