Extracting first element of multiple arrays within a cell

조회 수: 7 (최근 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 CenterFile Exchange에서 Logical에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by