Help me please, i have problem to count different value from 2 cell
like :
A = '1' '2' '5' '6' '2' '7' '7' '9' '10' '2' '4' '9' '2' '2'
B = '1' '2' '5' '6' '2' '5' '7' '9' '8' '2' '4' '9' '2' '2'
total different value in B from A is 2 among other is 5 below 7 and 8 below 10, can y'all solve this problem?
new user matlab here:(

 採用された回答

madhan ravi
madhan ravi 2019 年 2 月 25 日

1 投票

B(~cellfun(@isequal,B,A))

1 件のコメント

Angga
Angga 2019 年 2 月 25 日
編集済み: Angga 2019 年 2 月 25 日
Thankyou very much Madhan ravi, its work :)

サインインしてコメントする。

その他の回答 (1 件)

Jan
Jan 2019 年 2 月 25 日

2 投票

Fast:
sum(strcmp(A, B))

1 件のコメント

Angga
Angga 2019 年 2 月 25 日
編集済み: Angga 2019 年 2 月 25 日
Thankyou very much Jan, its work :)

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeElementary Math についてさらに検索

質問済み:

2019 年 2 月 25 日

編集済み:

2019 年 2 月 25 日

Community Treasure Hunt

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

Start Hunting!

Translated by