필터 지우기
필터 지우기

convert a 1*16 matrix to a 2*8 matrix

조회 수: 7 (최근 30일)
Eranja Noopehewa
Eranja Noopehewa 2018년 7월 31일
편집: Fangjun Jiang 2018년 7월 31일
I have a matrix of size 1*16 like [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16] i want to convert it to a 2*8 matrix like [1 2 3 4 5 6 7 8;9 10 11 12 13 14 15 16] (i.e the first eight elements in the first row and the second eight elements in the second row)

채택된 답변

Stephen23
Stephen23 2018년 7월 31일
>> V = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16];
>> reshape(V,[],2).'
ans =
1 2 3 4 5 6 7 8
9 10 11 12 13 14 15 16

추가 답변 (1개)

Fangjun Jiang
Fangjun Jiang 2018년 7월 31일
편집: Fangjun Jiang 2018년 7월 31일
reshape()
transpose()

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by