placing row values in columns

1 回表示 (過去 30 日間)
Ayesha Punjabi
Ayesha Punjabi 2019 年 4 月 16 日
回答済み: Geoff Hayes 2019 年 4 月 17 日
I have a 32 by 32 matrix which is named as c generated with all zeros in it
matrix a is 10 rows 16 column matrix which has all one and zero in it
a = 1
2
3
4
5
6
7
8
9
10
I am trying to place the values of a matrix in c matrix such that
c = 1 2
3 4
5 6
7 8
9 10
how should I do this ?? Kindly help
  1 件のコメント
Ayesha Punjabi
Ayesha Punjabi 2019 年 4 月 16 日
編集済み: per isakson 2019 年 4 月 17 日
here in matrix a 1,2,3,4...10 representation has 16 bits
say
1st row ---> 0000111100001111
2nd row ---> 0101010101010101
matrix c is expected to be
1st row ----> 00001111000011110101010101010101

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

採用された回答

Geoff Hayes
Geoff Hayes 2019 年 4 月 17 日
ayesha - if a is your 10x16 array and you want to combine subsequent rows, you can try using reshape as
a = randi([0,1], 10, 16);
c = reshape(a', 32, 5)';
But this will only create a 5x32 matrix. It is unclear (to me) how you can convert a 10x16 into a 32x32 though...

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by