%% Transform Time Series Object from Weekly to Quarterly Values Including NYSE Nonbusiness Days and Holidays
% Load the data from the file predict_ret_data.mat and use the fints function to create a time series object with a weekly frequency.

load predict_ret_data.mat
x0 = fints(expdates, expdata, {'Metric'}, 'w', 'Index')

%
% Use toquarterly with the optional BusDays argument set to 0 to obtain the quarterly cumulative sums for the x0 times series that includes NYSE nonbusiness days and holidays.

x1 = toquarterly(x0,'CalcMethod','CumSum','Busdays',0)

% Copyright 2012 The MathWorks, Inc.