フィルターのクリア

compare cell arrays for equality

4 ビュー (過去 30 日間)
masih
masih 2017 年 6 月 15 日
回答済み: Fangjun Jiang 2017 年 6 月 15 日
Hi, I have two cell arrays. One looks like this: glf=['070617', '091216','280217'] and the other one is grmmf=['070617', 280217', '070617','280217']. I want to start with the first element of glf which is '070617' and compare it with all elements of grmmf so that I know the first index in grmmf when the values are equal. And then continue checking all the rest of glf with each element of grmmf. How do we do this? Also, then I want to pair up the equal values in another matrix for later use. Please help. Thanks.

回答 (1 件)

Fangjun Jiang
Fangjun Jiang 2017 年 6 月 15 日
glf={'070617', '091216','280217'};
grmmf={'070617', '280217', '070617','280217'};
[LIA,LOCB]=ismember(glf,grmmf)

カテゴリ

Help Center および File ExchangeData Types についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by