A = [1; 3; 5; 7; 9; 11; 13; 15] //Parent Vector (column vector)
B =[3; 7; 11] //Vector obtained from A based on some constraints
C = [2; 4; 6] // It is a position vector showing the position of values of B in A.
So my question is, how to find the position vector (i.e. C) ?

 採用された回答

madhan ravi
madhan ravi 2019 年 9 月 8 日
編集済み: madhan ravi 2019 年 9 月 8 日

0 投票

C = find(ismember(A,B))

1 件のコメント

Jasraj Soni
Jasraj Soni 2019 年 9 月 8 日
Its working!
Thanks a lot.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Creating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by