Comparing two character array

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?

Antworten (1)

Walter Roberson
Walter Roberson am 8 Mär. 2020

0 Stimmen

Fterms = regexp(F, '\+', 'split');
Gterms = regexp(G, '\+', 'split');
all(ismember(Gterms, Fterms))

Kategorien

Mehr zu Matrices and Arrays finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 8 Mär. 2020

Beantwortet:

am 8 Mär. 2020

Community Treasure Hunt

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

Start Hunting!

Translated by