Extracting first element of multiple arrays within a cell

7 次查看(过去 30 天)
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?

采纳的回答

Jan
Jan 2022-11-8
result = cellfun(@(c) c(1), zz)
  6 个评论
Jan
Jan 2022-11-8
移动:Voss 2022-11-8
As far as I understood, this is wanted: [zz{1}(1), zz{2}(1), zz{3}(1), etc.]

请先登录,再进行评论。

更多回答(0 个)

产品

Community Treasure Hunt

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

Start Hunting!

Translated by