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 Exchange에서 Elementary 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