How do i manipulate matrix in form given below??

1 次查看(过去 30 天)
1 2; 3 4; 5 6; 7 8;
as
1 2 3 4; 5 6 7 8;

采纳的回答

Azzi Abdelmalek
Azzi Abdelmalek 2013-10-18
编辑:Azzi Abdelmalek 2013-10-18
A=[1 2; 3 4; 5 6; 7 8]
BB=reshape(A',4,[])'
  3 个评论
Azzi Abdelmalek
Azzi Abdelmalek 2013-10-18
编辑:Azzi Abdelmalek 2013-10-18
Please copy and paste the code
A=[1 2; 3 4; 5 6; 7 8]
BB=reshape(A',4,[])'
The result
>>BB =
1 2 3 4
5 6 7 8
%or maybe you want this
A=[1 2; 3 4; 5 6; 7 8]
BB=reshape(A',[],2)'

请先登录,再进行评论。

更多回答(1 个)

Andrei Bobrov
Andrei Bobrov 2013-10-18
reshape(a',size(a))';

类别

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