How to transpose a cell array ?
145 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
SUSHMA MB
el 2 de Dic. de 2015
Comentada: Yuri
el 14 de Sept. de 2023
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?
0 comentarios
Respuesta aceptada
Más respuestas (1)
the cyclist
el 2 de Dic. de 2015
Editada: the cyclist
el 2 de Dic. de 2015
To transpose the cell array itself:
C_transposed = C';
To transpose the matrices inside:
C_inside = cellfun(@transpose,C,'UniformOutput',false)
4 comentarios
Luke Aucoin
el 24 de Sept. de 2020
I used C_transposed = C' to transform a row array of character strings into a column array of the same strings. Thanks @the cyclist.
Ver también
Categorías
Más información sobre Matrices and Arrays en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!