How to find the unique elements in multiple strings?

24 ビュー (過去 30 日間)
Leon
Leon 2020 年 5 月 8 日
回答済み: Akihumi 2020 年 5 月 8 日
I have strings like the below. It can be 1 or can be more than 20. Here is an example with just 2 strings>
A = "CTDTMP, CTDSAL, CTDOXY, Silicate, Phosphate";
B = "CTDTMP, CTDSAL, CTDOXY, Ammonium";
How do I generat C as the below?
C = "CTDTMP, CTDSAL, CTDOXY, Silicate, Phosphate, Ammonium"
Thanks!

採用された回答

Akihumi
Akihumi 2020 年 5 月 8 日
unique([strsplit(A,', '), strsplit(B,', ')])

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

タグ

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by