cell to matrix conversion

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?

 Respuesta aceptada

Wayne King
Wayne King el 29 de Mayo de 2013

0 votos

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

Más respuestas (1)

Wayne King
Wayne King el 29 de Mayo de 2013
Editada: Wayne King el 29 de Mayo de 2013

0 votos

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 comentarios

John
John el 29 de Mayo de 2013
is there a way of not including [A,B,C,D], I would like to use these matrices in a for loop?
John
John el 29 de Mayo de 2013
that is to say : for each matrice I'll be performing certain function
Azzi Abdelmalek
Azzi Abdelmalek el 29 de Mayo de 2013
Then just use
X{1}
X{2}
X{3}
X{4}
John
John el 29 de Mayo de 2013
thankyou!

Iniciar sesión para comentar.

Categorías

Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 29 de Mayo de 2013

Community Treasure Hunt

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

Start Hunting!

Translated by