フィルターのクリア

why isn´t datevec accepting strings like this one: "12-12-2012 00:00"?

1 回表示 (過去 30 日間)
Inês Mendes
Inês Mendes 2015 年 6 月 2 日
編集済み: per isakson 2015 年 6 月 4 日
Hi guys,
I used datevec before but never with a string that points to midnight.
I have an array like this one:
01-06-2014 00:00,
01-06-2014 00:10,
01-06-2014 00:20,
01-06-2014 00:30,
01-06-2014 00:40,
02-06-2014 00:00,
02-06-2014 00:10,
02-06-2014 00:20,
02-06-2014 00:30,
02-06-2014 00:40]
the thing is: datevec doesn´t recognize any of the strings that have 00:00 and i don´t know why...
Does anyone know what to do?
Thanks is advance!
Inês

採用された回答

Ingrid
Ingrid 2015 年 6 月 2 日
I do not seem to be able to reproduce your problem. Are you sure you are providing strings to datevec (as this is not the case in your example)
datevec({'01-06-2014 00:00', '01-06-2014 00:10', '01-06-2014 00:20',...
'01-06-2014 00:30', '01-06-2014 00:40', '02-06-2014 00:00',...
'02-06-2014 00:10', '02-06-2014 00:20', '02-06-2014 00:30', '02-06-2014 00:40'})
ans =
2014 1 6 0 0 0
2014 1 6 0 10 0
2014 1 6 0 20 0
2014 1 6 0 30 0
2014 1 6 0 40 0
2014 2 6 0 0 0
2014 2 6 0 10 0
2014 2 6 0 20 0
2014 2 6 0 30 0
2014 2 6 0 40 0
  2 件のコメント
Inês Mendes
Inês Mendes 2015 年 6 月 2 日
yes..i have an excel in which the first column is a column with the date. When I extract it, the first column is a string array..then i try to use datevec and i doesn´t work...if i eliminate the first row it works because matlab doesn´t come across the 00:00 string..the thing is that in the middle of the array i have other 00:00 strings..
Ingrid
Ingrid 2015 年 6 月 2 日
than the problem is not with datevec but with the way the excel data is imported, how do you do this and what is the resulting column?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDates and Time についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by