MATRIX MANUPULATION

조회 수: 1 (최근 30일)
ofdma_matlab
ofdma_matlab 2011년 7월 9일
suppose i have a matrix like this, a = [ 1 2 3 4; 5 6 7 8; 9 10 11 12] i want it like b = [1 2; 3 4; 5 6; 7 8; 9 10; 11 12 ] any idea ? thanks in advance

답변 (1개)

the cyclist
the cyclist 2011년 7월 9일
a_t = a';
b_t = reshape(a_t,2,6);
b = b';
  댓글 수: 2
Oleg Komarov
Oleg Komarov 2011년 7월 9일
one liner: b = reshape(a.',2,[]).';
Fangjun Jiang
Fangjun Jiang 2011년 7월 9일
Golfer: b=reshape(a',2,[])'

댓글을 달려면 로그인하십시오.

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by