%% Access Row Times and Variable Data
% You can use dot syntax to access the row times of a timetable. Also, you can access individual variables using dot syntax, or all the data in a timetable using its second dimension name.
% Load a timetable from the MAT-file outdoors. Display the first three rows.

load outdoors
outdoors(1:3,:)

%
% Access the row times using the name of the row times vector. This name is also the name of the first dimension of the timetable. outdoors stores the row times as a datetime vector. Display the first three times.

outdoors.Time(1:3)

%
% Access the temperatures as a numeric vector, using its variable name.

outdoors.TemperatureF(1:3)

%
% Access all the timetable data as a matrix, using the syntax outdoors.Variables. This syntax uses the second dimension name of the timetable, and is equivalent to accessing all the contents using curly brace indexing, outdoors{:,:}. However, the matrix does not include row times, because the vector of row times is timetable metadata, not a variable. If the timetable data cannot be concatenated into a matrix, then an error message is raised.

outdoors.Variables

%
% Rename the second dimension of outdoors. If you change the name, then you can use the new name to access the data.

outdoors.Properties.DimensionNames{2} = 'Data';
outdoors.Data

% Copyright 2012 The MathWorks, Inc.