フィルターのクリア

extracting value from a vector

3 ビュー (過去 30 日間)
Andrea Miceli
Andrea Miceli 2021 年 3 月 18 日
コメント済み: Andrea Miceli 2021 年 3 月 18 日
Hello everybody!
i need help extracting some values ​​from a vector. More specifically, I have two vectors A and B (vector A contains 1: 3000 while vector B contains 10 random numbers) and I need to extract from vector A only the values ​​contained in Vector B. I have already tried with "== "and" iseq ", but the vectors are not the same length and therefore I cannot perform the operation.
thank you for your time!

採用された回答

Olof Engström
Olof Engström 2021 年 3 月 18 日
[intersection, indices] = intersect(A,B)
There you get the intersecting values and the indices to the intersecting values in A
  1 件のコメント
Andrea Miceli
Andrea Miceli 2021 年 3 月 18 日
Thank you! It's worked.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by