gusucode.com > datatypes 工具箱matlab源码程序 > datatypes/@timetable/copyRowTimesAsVariable.m

    function t = copyRowTimesAsVariable(tt)
%COPYROWTIMESASVARIABLE Helper function used by timetable join functions to copy over row time vector into the data

%   Copyright 2016 The MathWorks, Inc.

% Lengthen varDim with the row times name as the variable name
% Add the time as the data at the end of the table
tt.varDim = tt.varDim.lengthenTo(tt.varDim.length+1,tt.metaDim.labels(1)); % distinct from existing var names
tt.data{end+1} = tt.rowDim.labels;
t = tt;