Extracting specfic columns based on a matrix

1 回表示 (過去 30 日間)
Sha S
Sha S 2015 年 7 月 15 日
編集済み: Azzi Abdelmalek 2015 年 7 月 15 日
Hi,
I have matrix A which is 56x1 and I also have matrix B which is 6001x194.
The 56 numbers in matrix A are also found within column 191 of matrix B (they are 56 of the 6001 numbers found in column 191 of matrix B) . I want to extract columns 191, 192,193 & 194 from matrix B but only for the rows where the numbers from Matrix A are the same as the numbers from column 191 of matrix B.
How would I go about doing this? Thanks!
  1 件のコメント
Image Analyst
Image Analyst 2015 年 7 月 15 日
Did you try ismember()?

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

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2015 年 7 月 15 日
編集済み: Azzi Abdelmalek 2015 年 7 月 15 日
B (ismemeber (B(:,191), A),191:194)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLanguage Fundamentals についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by