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!