String matrix compare to get common in rows
이전 댓글 표시
Deal all, i have a problem to compare two string matrix :
A1 = {'AA', 'b' ; 'cc', 'ff'}
A2 = {'ee', 'AA' ; 'hhh', 'm'}
strcmp(A1,A2)
I get
A1 =
'AA' 'b'
'cc' 'ff'
A2 =
'ee' 'AA'
'hhh' 'm'
ans =
0 0
0 0
But i need to get
'AA' is common between A1 iand A2 in the row 1
Best regard
채택된 답변
추가 답변 (1개)
Geoff Hayes
2019년 6월 27일
>> ismember(A1,A2)
ans =
1 0
0 0
댓글 수: 5
Touts Touts
2019년 6월 27일
Geoff Hayes
2019년 6월 27일
So if 'AA' is in the second row, do you expect to see
'AA' : 2
? What happens if 'AA' is in more than one row?
Touts Touts
2019년 6월 27일
- what happens if 'AA' occurs on different rows?
- what happens if 'AA' occurs multiple times within one matrix?
Touts Touts
2019년 6월 28일
카테고리
도움말 센터 및 File Exchange에서 Interpolation에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!