How to find a value of a vector from another one?

There are two (A&B) vectors with N samples each. Each number of A has a specific value in B.
I have a value in A (a number among N samples), and interested to find it in B. For example:
A=[250 400 300 200 100 ...]
B=[5 6 1 2 9 ...]
I want to find B when A =200, the answer is B=2 (in this case).
Thanks

 채택된 답변

Ingrid
Ingrid 2015년 11월 25일

0 개 추천

is this what you mean?
B(A==200)

댓글 수: 1

I thought it is much more complex and need to use arrayfun.
Thank you

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

질문:

2015년 11월 25일

댓글:

2015년 11월 25일

Community Treasure Hunt

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

Start Hunting!

Translated by