How can I delete repeated elements? (not unique!)
1 回表示 (過去 30 日間)
古いコメントを表示
採用された回答
その他の回答 (2 件)
Joakim Magnusson
2014 年 8 月 13 日
I don't know such a function, but try this:
Output = Input;
0 = 1;
while i < size(Output,2)
if Output(i) == Output(i+1)
Output(i+1) = [];
else
i = i+1;
end
end
0 件のコメント
Andrei Bobrov
2014 年 8 月 13 日
編集済み: Andrei Bobrov
2014 年 8 月 13 日
Output = Input([true,diff(Input)~=0])
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Surface and Mesh Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!