Borrar filtros
Borrar filtros

how to convert cell into matrix

1 visualización (últimos 30 días)
HC Song
HC Song el 9 de Feb. de 2016
Respondida: Stephen23 el 12 de Feb. de 2016
assume that a={[1 2 3],[2 3 4;1 2 3]} I want to convert a into a=[1 2 3;2 3 4;1 2 3]. Is there any easy way? thanks

Respuesta aceptada

Stephen23
Stephen23 el 12 de Feb. de 2016
>> a={[1 2 3],[2 3 4;1 2 3]}
a =
[1x3 double] [2x3 double]
>> vertcat(a{:})
ans =
1 2 3
2 3 4
1 2 3

Más respuestas (1)

Kiran
Kiran el 12 de Feb. de 2016
Hi Song,
You can use 'cat' command to concatenate array according to your need.
m = cat(1,a{1},a{2})
Above command will concatenate the array 'a' along vertical direction as you need.

Categorías

Más información sobre Characters and Strings en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by