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 Center および File ExchangeTime Series Objects についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by