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
the cyclist 2011년 7월 9일

0 개 추천

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,[])'

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

카테고리

도움말 센터File Exchange에서 Data Types에 대해 자세히 알아보기

질문:

2011년 7월 9일

Community Treasure Hunt

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

Start Hunting!

Translated by