Matrix comparison with unequal sized matrices
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi
Let's say I have:
A = [A1, A2, A3, A4, A5]
B= [B1,B2,B4,B4,B5]
N = counter
If I want to:
- Compare B1 to A2. If B1 is greater than A2, increment N by 1. Else do nothing.
- Compare B2 to A3. If B2 is greater than A3, increment N by 1. Else do nothing.
- Compare B3 to A4. If B3 is greater than A4, increment N by 1. Else do nothing.
- Compare B4 to A5. If B4 is greater than A5, increment N by 1. Else do nothing.
- and ignore B5 since it has nothing to compare to
Is there a way to define above description in MATLAB...?
Thank you in advance
채택된 답변
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!