How to combine columns from large dataset to datetime with correct vector or doublestring?
2 次查看(过去 30 天)
显示 更早的评论
I am trying to combine date and time so that I can plot discharge over time. Year, month, day, and hour (in minutes) are in different columns. I have tried several this including
Date=datetime(dataTable(:,3:5))+hours(data(:,8));
and get errors. For this it says
Input data must be a numeric array, a string array, a cell array containing character vectors, or a char matrix.
Any suggestions?
0 个评论
采纳的回答
Star Strider
2023-11-12
Use curly brackets {} instead of parentheses when referring to numbered table variables —
Date=datetime(dataTable{:,3:5})+hours(dataTable{:,8});
dataTable = table(rand(2,1),rand(2,1),[2023;2023],[11;11],[10;11],rand(2,1),rand(2,1),[11;13])
Date=datetime(dataTable{:,3:5})+hours(dataTable{:,8})
.
2 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Dates and Time 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!