Difference between the arrays
조회 수: 5 (최근 30일)
이전 댓글 표시
I have 2 arrays A= [1 2 3 4] and B = [2 3 4 5] representing paths in a graph. I want to find difference between the arrays. A-B =[1 2] and B-A = [4 5]. Can any one help. Thanks in advance.
댓글 수: 2
Cyrus
2016년 8월 11일
Hi,
Shouldn't A-B = [1] and B-A = [5] ?
to my understanding you want to keep the numbers that are not repeated in the other array, is that right?
채택된 답변
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!