Hi I have an array which looks like this:
'''27/01/2012 15:30:00'''
'''27/01/2012 15:31:33'''
'''27/01/2012 15:49:19'''
'''27/01/2012 15:49:19'''
'''27/01/2012 15:50:26'''
I want to just have the TIME and in a NON-STRING format. Any help?

3 件のコメント

Friedrich
Friedrich 2012 年 2 月 14 日
You cant keep the format 15:30:00 when using a a non string format. only way is an numeric array of the ascii value of each char. but this doesnt make much sense.
You can use the datenum function to convert the time in a numerical value, e.g. datenum('15:30:00','hh:mm:ss'). The important question is why do you need a Non String format and what would you do with it.
Mate 2u
Mate 2u 2012 年 2 月 14 日
I need to eventually make regular 1 second intervals and for price to be maintained until it is changed which is in another column.
Mate 2u
Mate 2u 2012 年 2 月 14 日
See my last question before this one for my final objective.

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

 採用された回答

Mate 2u
Mate 2u 2012 年 2 月 14 日

0 投票

Hi this does not work for me, I think maybe because the array is a cell array?

2 件のコメント

Friedrich
Friedrich 2012 年 2 月 14 日
one can use datestr and datenum to do it in a dirty way:
a_1 = datenum('27/01/2012 15:30:00','dd/mm/yyyy HH:MM:SS')
a_2 = datenum('27/01/2012 15:31:33','dd/mm/yyyy HH:MM:SS')
tmp = datestr(a_1:0.00001:a_2);
time_stamps = unique(mat2cell(tmp,ones(108,1),20))
Mate 2u
Mate 2u 2012 年 2 月 14 日
Great got the time stamps. If you can look at my previous question, I just need to assign the relevant values to the time stamps now.

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeDates and Time についてさらに検索

タグ

質問済み:

2012 年 2 月 14 日

編集済み:

2013 年 10 月 11 日

Community Treasure Hunt

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

Start Hunting!

Translated by