www.gusucode.com > matlab 案例源码 matlab代码程序 > matlab/UniqueRowsinTableExample.m
%% Unique Rows in Table %% % Define a table with repeated data. Name = {'Fred';'Betty';'Bob';'George';'Jane'}; Age = [38;43;38;40;38]; Height = [71;69;64;67;64]; Weight = [176;163;131;185;131]; A = table(Age,Height,Weight,'RowNames',Name) %% % Find the unique rows of |A|. C = unique(A) %% % |unique| returns the rows of |A| in sorted order by the first variable, % |Age| and then by the second variable, |Height|.