How can I convert cell to a timetable?
15 次查看(过去 30 天)
显示 更早的评论
Hi all, I have a table that is consists of both double (temperature, salinity) and cell array (sampling time). But I want to convert the table into a time timetable making sure that the time column is no longer a cell array, rather it is in a datetime format = YY:MM:DD HH:MM:SS.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1335479/image.png)
I have attached the .mat file. Can anyone please help?
0 个评论
采纳的回答
Walter Roberson
2023-3-24
编辑:Walter Roberson
2023-3-24
times = datetime(YourCell{:,4}, 'InputFormat', "yyyy-MM-dd'T'hh:mm:ss'Z'", 'TimeZone', 'GMT');
data = table2timetable(cell2table(YourCell(:,[1:3,5:end])), 'RowTimes', times);
0 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!