How do i manipulate matrix in form given below??

1 2; 3 4; 5 6; 7 8;
as
1 2 3 4; 5 6 7 8;

1 件のコメント

Jos (10584)
Jos (10584) 2013 年 10 月 18 日
Homework? I suggest you read the help of RESHAPE and TRANSPOSE

サインインしてコメントする。

 採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2013 年 10 月 18 日
編集済み: Azzi Abdelmalek 2013 年 10 月 18 日

0 投票

A=[1 2; 3 4; 5 6; 7 8]
BB=reshape(A',4,[])'

3 件のコメント

Paranshu
Paranshu 2013 年 10 月 18 日
編集済み: Azzi Abdelmalek 2013 年 10 月 18 日
it should be 2 rather than 4
Even this doesn't solve the problem...it becomes [1 5 2 6; 3 7 4 8] rather it should be [1 2 3 4;5 6 7 8]
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)'
Paranshu
Paranshu 2013 年 10 月 18 日
It was really helpfull..thanks

サインインしてコメントする。

その他の回答 (1 件)

Andrei Bobrov
Andrei Bobrov 2013 年 10 月 18 日

0 投票

reshape(a',size(a))';

カテゴリ

ヘルプ センター および File ExchangeMatrix Indexing についてさらに検索

質問済み:

2013 年 10 月 18 日

コメント済み:

2013 年 10 月 18 日

Community Treasure Hunt

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

Start Hunting!

Translated by