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!