%% Preallocate Timetable Using Sample Rate
% Specify a sample rate of 1000 Hz and preallocate a timetable. You also can specify a start time.

sz = [4 3];
varTypes = {'uint64','double','duration'};
TT = timetable('Size',sz,'VariableTypes',varTypes,'SampleRate',1000,'StartTime',seconds(15))

%
% Index into the third row, by specifying its time, and add a row of data.

TT(seconds(15.002),:) = {50,1.37,minutes(76)}

% Copyright 2012 The MathWorks, Inc.