My problem of sequence
이전 댓글 표시
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
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
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
Walter Roberson
2026년 10월 8일 5:41
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
2026년 10월 8일 16:25
카테고리
도움말 센터 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!