Converting Numeric array into a datetime Array

Can you kindly assist, i am trying to convert my Time which is numeric array(22x1 double) into a 22x1 datetime array but it is giving me a date which has errors although my time is correct.
datetime(Time1,’ConvertFrom’,’datenum’)

4 件のコメント

Dyuman Joshi
Dyuman Joshi 2023 年 10 月 25 日
What kind of error? Code not running properly error? or Output does not match the expected value error?
Also, please attach the values for the numeric array you are working with.
dpb
dpb 2023 年 10 月 25 日
Maybe the problem is it wasn't created by MATLAB @datenum but came from Excel??? It doesn't use the same reference date as does MATLAB (and there are other issues as well), but for starters if it was imported from Excel try
datetime(Time1,xConvertFromc,eExcell)
Martha
Martha 2023 年 10 月 25 日
Hi, Thank you . I found a way that could manipulate the code
dpb
dpb 2023 年 10 月 25 日
@Martha - glad you found a solution but I will close this Answers thread as being noninformative unless you can show the form of the data and what the solution turned out to be. Otherwise, it doesn't have any useful content that would help anybody else if returned in a search...

回答 (0 件)

この質問は閉じられています。

製品

リリース

R2023b

質問済み:

2023 年 10 月 25 日

閉鎖済み:

2023 年 10 月 25 日

Community Treasure Hunt

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

Start Hunting!

Translated by