How to unpack contents of a cell array?

98 visualizaciones (últimos 30 días)
Elissa
Elissa el 25 de Abr. de 2018
Editada: Stephen23 el 23 de Feb. de 2022

I have a cell array:

I try to unpack the contents of each cell:

h = size(dom_psth_tb,1);
dom_psth_tb = dom_psth_tb{1:h,1};    

But the result is the contents of only one cell:

Help is much appreciated!

Respuesta aceptada

Stephen23
Stephen23 el 25 de Abr. de 2018
Editada: Stephen23 el 23 de Feb. de 2022
You can use a comma-separated list, and simply concatenate the contents into one matrix:
mat = vertcat(dom_psth_tb{:})
Read this to know more about comma-separated lists:
  2 comentarios
Elissa
Elissa el 25 de Abr. de 2018
Thank you!
David Walwark
David Walwark el 8 de Ag. de 2018
The simple solution we all knew existed, thank you.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Data Types 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