Hi Everyone,
I have a cell array 12x5 where each element is datetime array. Someone knows how to convert cell array into datetime array? To be clearer I would like to obtain an array with size 1472x1 . Thanks.
12×1 cell array
{125×1 datetime}
{113×1 datetime}
{125×1 datetime}
{121×1 datetime}
{125×1 datetime}
{121×1 datetime}
{125×1 datetime}
{125×1 datetime}
{121×1 datetime}
{125×1 datetime}
{121×1 datetime}
{125×1 datetime}

 Respuesta aceptada

Bhaskar R
Bhaskar R el 28 de Feb. de 2020
result = cellfun(@vertcat, vertcat(your_array{:}))

3 comentarios

it doesn't work. It gives me this error.
cellfun(@vertcat, vertcat(time_date{:}))
Error using cellfun
Input #2 expected to be a cell array, was datetime instead.
Bhaskar R
Bhaskar R el 28 de Feb. de 2020
vertcat(time_date{:}) % try this
Valerio Gianforte
Valerio Gianforte el 28 de Feb. de 2020
Ok, now it does work. Thank you so much.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Data Type Conversion en Centro de ayuda y File Exchange.

Productos

Versión

R2019a

Etiquetas

Preguntada:

el 28 de Feb. de 2020

Comentada:

el 28 de Feb. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by