How do I fix Invalid use of operator in the Code
1 次查看(过去 30 天)
显示 更早的评论
I want to create a datetime table from excel having date and time in two separate columns.
T = readtable('LP.xlsx');
Col2 = datetime(str2double(T{:,2}), 'ConvertFrom','excel', 'Format','HH:mm:ss'); % Dates
Col1 = datetime(str2double({:,1}),'ConvertFrom','excel', 'Format','dd/MM/yyyy'); % Times
DT = table(Col1+timeofday(Col2), 'VariableNames',{'DateTime'}); % Combined
T = [DT T(:,3:end)]; % New Table
FirstFiveRows = T(1:5,:)
Please How do I merge column 1(Date) and column 2(Time) to one column having datetime? Thanks
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!