Comparing two character array

조회 수: 3 (최근 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 CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by