Issue with array2timetable = Row times must be datetime or duration vector with one time for each row in input timetable.

Hey guys,
I have an issue with array2timetable!
example data is given :)
length(t{1}) == length(d{1}) %t and d are same length
TT = array2timetable(t{1},'RowTimes',d{1});
When I want to execute it, get this error:
Error using array2timetable (line 71): Row times must be datetime or duration vector with one time for each row in input timetable.
I don't understand why.. can someone help me please? Thank you!

4 commentaires

Could you upload the data (or a small sample that exhibits the problem) in a MAT file?
d is type datetime and t is type double.
If that were the case, d{1} and t{1} would both cause an error. {} indexing is not valid for datetime or double.
What is
class d
class t
class d{1}
class t{1}
size(d)
size(t)
size(d{1})
size(t{1})
?
its
char
char
char
char
1 1
1 1
696 1
696 1
the cell array 1 from d (d{1}) is datetime
the same with t

Connectez-vous pour commenter.

Réponses (2)

Jon
Jon le 5 Août 2019
Modifié(e) : Jon le 5 Août 2019
It looks like you may have the arguments reversed. The first argument should be the data (doubles) the last argument should be the time values.
See

2 commentaires

Sorry, I didn't read your description carefully, I just assumed that d was mnemonic for double and t for time, but I see that is not the case.
no sorry :D
d stands for datetime haha

Connectez-vous pour commenter.

I attached example data

4 commentaires

I can not reproduce your problem with your attached example
I get this:2019-08-05 09_32_52-MATLAB R2019a.png
Wow this way it is working for me as well.
Did you mean to accept your own posting of example data as the answer? Maybe makes sense as in the end there wasn't really any explanation for what had gone wrong.
The example data should have been posted as a comment to the question, and indeed it shouldn't have been accepted as the answer.

Connectez-vous pour commenter.

Catégories

Community Treasure Hunt

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

Start Hunting!

Translated by