Comparing two character array

13 Ansichten (letzte 30 Tage)
vedesh Mohit
vedesh Mohit am 8 Mär. 2020
Beantwortet: Walter Roberson am 8 Mär. 2020
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
Fterms = regexp(F, '\+', 'split');
Gterms = regexp(G, '\+', 'split');
all(ismember(Gterms, Fterms))

Kategorien

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

Community Treasure Hunt

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

Start Hunting!

Translated by