How to find the unique elements in multiple strings?

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 日

0 投票

unique([strsplit(A,', '), strsplit(B,', ')])

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeCharacters and Strings についてさらに検索

製品

リリース

R2020a

タグ

質問済み:

2020 年 5 月 8 日

回答済み:

2020 年 5 月 8 日

Community Treasure Hunt

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

Start Hunting!

Translated by