How to combine repeated same value to a single value or variable
古いコメントを表示
X=[3 5 ; 1 2 ; 5 6 ; 3 5 ] How to make like Y=[3 5; 1 2; 5 6] ie; representing [3 5] for single time rather displaying it twice
回答 (1 件)
Rik
2018 年 3 月 12 日
1 投票
3 件のコメント
RAJASEKAR S
2018 年 3 月 12 日
James Tursa
2018 年 3 月 12 日
See the 'rows' option.
Rik
2018 年 3 月 12 日
That is why the link leads you to the 'rows' flag example:
[C,ia,ic] = unique(A(:,1:2),'rows')
In your case:
X=[3 5 ; 1 2 ; 5 6 ; 3 5 ];
Y=unique(X,'rows','stable');
カテゴリ
ヘルプ センター および File Exchange で Mathematics についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!