%% Return Timetable from Spreadsheet Datastore
% Use the OutputType and RowTimes name-value pairs to make SpreadsheetDatastore return timetables instead of tables.
%
% Create a datastore for tsunamis_dated.xlsx. Specify 'OutputType' as 'timetable' so that SpreadsheetDatastore returns timetables instead of tables.

ssds = spreadsheetDatastore('tsunamis_dated.xlsx','OutputType','timetable');
preview(ssds)

% When you do not specify 'RowTimes', spreadsheetDatastore uses the first datetime or duration variable as the row times. In this case, the Date variable is used for the row times. This data has two datetime variables: Date and Time. The Date variable does not include information about hours, minutes, or seconds, while the Time variable has the specific time of each event.
%
% Specify the 'RowTimes' option to use the event times (the Time variable) as the row times.

ssds = spreadsheetDatastore('tsunamis_dated.xlsx','OutputType','timetable','RowTimes','Time');
preview(ssds)

% Copyright 2019 The MathWorks, Inc.
%
%
%