Effacer les filtres
Effacer les filtres

how to convert cell into matrix

1 vue (au cours des 30 derniers jours)
HC Song
HC Song le 9 Fév 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

Réponse acceptée

Stephen23
Stephen23 le 12 Fév 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

Plus de réponses (1)

Kiran
Kiran le 12 Fév 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.

Catégories

En savoir plus sur Matrices and Arrays dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by