Effacer les filtres
Effacer les filtres

cell to matrix conversion

1 vue (au cours des 30 derniers jours)
John
John le 29 Mai 2013
I have following cell matrix X(1x4):
[] [] [1,2,3;1,3,4] [1,2,3,4;1,3,4,2]
how do i split them into four seperate matrices?

Réponse acceptée

Wayne King
Wayne King le 29 Mai 2013
Then as Azzi says, just extract them in a for loop
X = {[] [] [1,2,3;1,3,4] [1,2,3,4;1,3,4,2]};
for ii = 1:4
size(X{ii}) % do whatever you want here
end

Plus de réponses (1)

Wayne King
Wayne King le 29 Mai 2013
Modifié(e) : Wayne King le 29 Mai 2013
X = {[] [] [1,2,3;1,3,4] [1,2,3,4;1,3,4,2]};
[A,B,C,D] = deal(X{:});
Note that A and B are empty as expected.
  4 commentaires
Azzi Abdelmalek
Azzi Abdelmalek le 29 Mai 2013
Then just use
X{1}
X{2}
X{3}
X{4}
John
John le 29 Mai 2013
thankyou!

Connectez-vous pour commenter.

Catégories

En savoir plus sur Loops and Conditional Statements 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