Extracting rows based based on criteria from two columns

3 ビュー (過去 30 日間)
Mido
Mido 2016 年 11 月 4 日
回答済み: KSSV 2016 年 11 月 4 日
A= [1 1 4;
1 2 6;
1 3 9;
1 4 10;
2 1 12;
2 2 15;
2 3 20;
2 4 45]
I want to extract rows from the matrix as follows: For each consecutive number in the first column extract rows using increment of 2 in the second column. The result will be:
A= [1 2 6;
1 4 10;
2 2 15;
2 4 45]

採用された回答

KSSV
KSSV 2016 年 11 月 4 日
iwant = A(2:2:end,:)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGenomics and Next Generation Sequencing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by