Convert a column of dates

조회 수: 1 (최근 30일)
Stephen Jones
Stephen Jones 2012년 3월 15일
댓글: Sara Mendiola 2017년 3월 1일
I can use the datenum command for individual cells, but can not seem to apply it to a whole column. What am I doing wrong? Thanks, Stephen

채택된 답변

Honglei Chen
Honglei Chen 2012년 3월 15일
try cellfun
cellfun(@datenum,...
see the doc
doc cellfun

추가 답변 (1개)

Jan
Jan 2012년 3월 15일
datenum does accept a column cell:
datenum({'15-Mar-2012 23:53:23'; '15-Mar-2012 23:53:23'})
>> ans =
7.3494e+005
7.3494e+005
  댓글 수: 3
Jan
Jan 2012년 3월 16일
I suggest to read the documentation: help datenum, doc datenum
There you find:
datenum({'20120315'; '20120316'}, 'yyyymmdd')
Sara Mendiola
Sara Mendiola 2017년 3월 1일
How about datestr for a column?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Time Series Objects에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by