Extracting first element of multiple arrays within a cell

7 visualizaciones (últimos 30 días)
uzzi
uzzi el 8 de Nov. de 2022
Movida: Voss el 8 de Nov. de 2022
Hello,
I have a cell name zz with 1x6 of datetime . And inside of zz are with YYYY-MM-DD hh:mm:ss.SSS forma. I want to create a variabe which consist of the first elements datetime value of zz of all 6 columns. I am trying and I am stucked with it. Can someone help me?

Respuesta aceptada

Jan
Jan el 8 de Nov. de 2022
result = cellfun(@(c) c(1), zz)
  6 comentarios
uzzi
uzzi el 8 de Nov. de 2022
Thank you. It works.
Jan
Jan el 8 de Nov. de 2022
Movida: Voss el 8 de Nov. de 2022
As far as I understood, this is wanted: [zz{1}(1), zz{2}(1), zz{3}(1), etc.]

Iniciar sesión para comentar.

Más respuestas (0)

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by