%% Convert a Price Series to a Return Series Using timetable Input
% Use timetable input to convert a price series to a return series, given periodic returns of two stocks observed in the first, second, third, and fourth quarters.

RetSeries = [0.10 0.12
             0.05 0.04
            -0.05 0.05];

RetTimes = datetime({'6/18/2001','9/17/2001','12/18/2001'},'InputFormat','MM/dd/uuuu','Locale','en_US');
RetSeries = array2timetable(RetSeries,'RowTimes',RetTimes);
StartTime = datetime('12/18/2000','InputFormat','MM/dd/uuuu','Locale','en_US');


[TickSeries,TickTimes] = ret2tick(RetSeries,'StartTime',StartTime)

% Copyright 2018 The MathWorks, Inc.