MATRIX MANUPULATION
이전 댓글 표시
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
2011년 7월 9일
a_t = a';
b_t = reshape(a_t,2,6);
b = b';
댓글 수: 2
Oleg Komarov
2011년 7월 9일
one liner: b = reshape(a.',2,[]).';
Fangjun Jiang
2011년 7월 9일
Golfer: b=reshape(a',2,[])'
카테고리
도움말 센터 및 File Exchange에서 Data Types에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!