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일
unique([strsplit(A,', '), strsplit(B,', ')])

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Characters 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