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일
With linear indexing:
B = A([4,8,3])

카테고리

도움말 센터File Exchange에서 Resizing 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