Remove duplicate on rows

2 ビュー (過去 30 日間)
Heman KHOUILLA
Heman KHOUILLA 2022 年 9 月 7 日
回答済み: Ergin Sezgin 2022 年 9 月 7 日
I'm working with nominative patent data from french applicants. So my file contains the name of the patent applicants. Each row is a patent, and each contains the name of one of the patent applicants. But there are duplicate. I would like to clean each row of the duplicate names (since each row is a patent and the names are in column).
Does anybody have an idea ?

回答 (1 件)

Ergin Sezgin
Ergin Sezgin 2022 年 9 月 7 日
Hello Heman,
Try using unique function which returns only the unique elements in the array.
newData = unique(yourData);
If you want the process to be non-case sensitive, for example if there are two elements 'Adam Smith' and 'adam smith', you can use lower function, and then unique function.
[~, idx] = (unique(lower(yourData)));
newData = yourData(idx)
I hope it helps.

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by