필터 지우기
필터 지우기

How to find the common values in two arrays

조회 수: 813 (최근 30일)
Jisha
Jisha 2012년 5월 28일
댓글: Dyuman Joshi 2024년 5월 8일
Suppose I have two vectors
a= 1 2 3 4
b= 4 5 6 7 9
How do I find which value is common to both
in above case it is 4

채택된 답변

Thomas
Thomas 2012년 5월 28일
You need the intersect command
doc intersect
in your case
[val,pos]=intersect(a,b) % gives common val and its position in 'a'

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Types에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by