My date base are two matrices R2_a = 3500000x30 and R3_a 3500000x30. The rows are integer numbers, one to sixty-seven, in ascendent sequence successive by zeros. I want to find one line at R2_a and another line at R3_a that have, in sequence, theses numbers:
2,3,4,5,6,8,10,11,14,15,17,18,19,23,26,28,29,31,36,38,43,44,45,47,50,54,57,58,59,60,61,62,63,64,65.
Example:
2 3 4 5 6 8 10 11 14 15 17 18 19 23 26 28 29 31 36 38 43 44 45 47 50 54 57 58 59 60 61 62 63 64 65 a
3 4 6 7 8 9 13 15 19 22 23 26 30 31 32 36 38 39 40 43 44 45 46 56 57 58 R2_a 2 5 10 11 14 15 17 18 22 28 29 30 34 46 47 49 50 54 57 59 67 R3_a

댓글 수: 1

Walter Roberson
Walter Roberson 2026년 10월 8일 5:33
Are the a and R2_a and R3_a part of the matrices? If so then what datatype are the matrices?

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2026년 10월 8일 5:36

0 개 추천

Your target vector is length 35. You have defined your matrices as having rows of length 30. It is not possible for a matrix of width 30 to match a target vector of width 35.

댓글 수: 2

targetvector = [2,3,4,5,6,8,10,11,14,15,17,18,19,23,26,28,29,31,36,38,43,44,45,47,50,54,57,58,59,60,61,62,63,64,65];
match1 = find(ismember(R2_a, targetvector, 'rows'));
match2 = find(ismember(R3_a, targetvector, 'rows'));
match1 with contain row numbers of R2_a that match (possibly empty, possibly multiple entries), and match2 will contain row numbers of R3_a that match (possibly empty, possibly multiple entries)
AIRTON
AIRTON 2026년 10월 8일 16:25
Thanks Walter! The datatype of matrices are uint32! I don't want to find "targetvector" in R2_a or R3_a because the dimensions are different. I want to find one row in R2_a that has those numbers into "targetvector" and if R2_a has not all, then I can to find them in R3_a. But with a condition. In the same sequence of targetvector. Example: R2_a has 2,5,6,10,17. R3_a has 3,4,8,11,14,15.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터 및 File Exchange에서 Logical에 대해 자세히 알아보기

태그

질문:

2026년 10월 8일 3:43

댓글:

2026년 10월 8일 16:25

Community Treasure Hunt

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

Start Hunting!

Translated by