Clear Filters
Clear Filters

How do i manipulate matrix in form given below??

1 view (last 30 days)
1 2; 3 4; 5 6; 7 8;
as
1 2 3 4; 5 6 7 8;
  1 Comment
Jos (10584)
Jos (10584) on 18 Oct 2013
Homework? I suggest you read the help of RESHAPE and TRANSPOSE

Sign in to comment.

Accepted Answer

Azzi Abdelmalek
Azzi Abdelmalek on 18 Oct 2013
Edited: Azzi Abdelmalek on 18 Oct 2013
A=[1 2; 3 4; 5 6; 7 8]
BB=reshape(A',4,[])'
  3 Comments
Azzi Abdelmalek
Azzi Abdelmalek on 18 Oct 2013
Edited: Azzi Abdelmalek on 18 Oct 2013
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)'

Sign in to comment.

More Answers (1)

Andrei Bobrov
Andrei Bobrov on 18 Oct 2013
reshape(a',size(a))';

Categories

Find more on Resizing and Reshaping Matrices in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!