Extracting first element of multiple arrays within a cell

5 ビュー (過去 30 日間)
uzzi
uzzi 2022 年 11 月 8 日
移動済み: Voss 2022 年 11 月 8 日
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 件のコメント
uzzi
uzzi 2022 年 11 月 8 日
Thank you. It works.
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 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by