How do I fix Invalid use of operator in the Code
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
MBUNYA NERVILLE ANYANG
am 24 Mai 2023
Kommentiert: MBUNYA NERVILLE ANYANG
am 24 Mai 2023
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 Kommentare
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Spreadsheets finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!