Each cell in the cell array contains a matrix, e.g.,
Suppose the cell array is
[8x1] cell
Inside which their are some matrix like
[6x2] double
[7x2] double
[6x2] double
[7x2] double
[6x2] double
[7x2] double
[6x2] double
[7x2] double
Now i want to transpose the cell array into
[1x8] cell
How to do it?

 採用された回答

SUSHMA MB
SUSHMA MB 2015 年 12 月 2 日

4 投票

reshape command works for this example well. For poly as the name of the cell array,
polyre = reshape(poly,[1 8]);

その他の回答 (1 件)

the cyclist
the cyclist 2015 年 12 月 2 日
編集済み: the cyclist 2015 年 12 月 2 日

16 投票

To transpose the cell array itself:
C_transposed = C';
To transpose the matrices inside:
C_inside = cellfun(@transpose,C,'UniformOutput',false)

4 件のコメント

SUSHMA MB
SUSHMA MB 2015 年 12 月 2 日
Thank you for the answer. I tried the above one but its not working.
Murari Mandal
Murari Mandal 2016 年 11 月 4 日
It is working just fine.
Luke Aucoin
Luke Aucoin 2020 年 9 月 24 日
I used C_transposed = C' to transform a row array of character strings into a column array of the same strings. Thanks @the cyclist.
Yuri
Yuri 2023 年 9 月 14 日
Thanks a lot!

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

カテゴリ

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

タグ

質問済み:

2015 年 12 月 2 日

コメント済み:

2023 年 9 月 14 日

Community Treasure Hunt

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

Start Hunting!

Translated by