Use a datetime. When you plot, your data type is honored. You can use xtickformat to format how the data appears. opts = detectImportOptions("CTD12-17.xlsx");
opts.VariableNamingRule = "preserve";
opts = setvartype(opts,"Time","duration");
opts = setvaropts(opts,"Time","InputFormat","hh:mm:ss","DurationFormat","hh:mm:ss");
opts = setvartype(opts,"Date_TimeCombined","datetime");
opts = setvaropts(opts,"Date_TimeCombined","InputFormat","dd/MM/yy HH:mm:ss");
data = readtable("CTD12-17.xlsx",opts)
plot(data.("Date + Time Combined"),data.("Bottom Water Mean N+N"))
Best Answer