How to remove duplicates from a matrix without using unique?

d = [1 6 -1 5 6 7 0 5 6 0 8 0]
a = [-1 0 1 5 6 7 8]
How can I convert the vector d to vector a?
Please dont use unique

回答 (2 件)

John D'Errico
John D'Errico 2020 年 11 月 23 日

1 投票

How could you use the output of a sort to help? Why not make an effort?

カテゴリ

ヘルプ センター および File ExchangeData Types についてさらに検索

質問済み:

2020 年 11 月 23 日

回答済み:

2020 年 11 月 23 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by