Comparing two character array

5 ビュー (過去 30 日間)
vedesh Mohit
vedesh Mohit 2020 年 3 月 8 日
回答済み: Walter Roberson 2020 年 3 月 8 日
I have two character arrays, F='(AB'')+(BC)+(C)' and G='(BC'')+(C)+(AB)'. How can I compare all the terms of G to determine if it exist in F?

回答 (1 件)

Walter Roberson
Walter Roberson 2020 年 3 月 8 日
Fterms = regexp(F, '\+', 'split');
Gterms = regexp(G, '\+', 'split');
all(ismember(Gterms, Fterms))

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by