selecting unique rows
古いコメントを表示
I have an matrix of 6 columns,all columns have repeated numbers,now i want to select only unique values of that matrix ,please help
採用された回答
その他の回答 (2 件)
TAB
2012 年 1 月 18 日
Type
>> doc unique
on your command window
Wayne King
2012 年 1 月 18 日
C = unique(A,'rows');
Selects the unique rows of the matrix A in sorted order. Is that what you mean?
6 件のコメント
kash
2012 年 1 月 18 日
Wayne King
2012 年 1 月 18 日
then just unique(A)
kash
2012 年 1 月 18 日
Wayne King
2012 年 1 月 18 日
I think you need to make your use case clearer, with your above example, show us what you want the output to look like.
kash
2012 年 1 月 18 日
Andrei Bobrov
2012 年 1 月 18 日
a = [1 2 7 8 9 0
2 2 71 2 4 1];
out = a(all(diff(sort(a,2),1,2) > 1e4*eps,2),:)
カテゴリ
ヘルプ センター および File Exchange で Shifting and Sorting Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!