How to construct a vector from specific elements in a matrix

Given the matrix A = [3 4 7; 8 2 1; 6 0 9], how would I create a vector that is composed of the first row second column, second row third column and third row first column of matrix A (ie B = [4; 1; 6])

 採用された回答

その他の回答 (1 件)

Stephen23
Stephen23 2018 年 9 月 20 日
編集済み: Stephen23 2018 年 9 月 20 日

0 投票

With linear indexing:
B = A([4,8,3])

カテゴリ

ヘルプ センター および File ExchangeResizing and Reshaping Matrices についてさらに検索

製品

リリース

R2018a

タグ

質問済み:

2018 年 9 月 20 日

編集済み:

2018 年 9 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by