How to add date column with the corresponding variables in rolling window

1 view (last 30 days)
Dear Matlab-users,
My excel file consists of 4 columns of daily data. First column represent the date column which is same for all the 3 rest variable columns. I calculating the genhurst function for my 3 series in a rolling window framework with the following code.
[numeric,textdata,rawdata]=xlsread('JK1.xlsx');
num1=numeric(:,isfinite(numeric(1, :)));
indexdata = rawdata(:,1:4);
%%My rolling
windowsize = 100;
startrows = 1:size(num1, 1)-windowsize+1;
HH = cell(numel(startrows), size(num1, 2));
for col = 1:size(num1, 2)
for row = 1:numel(startrows)
HH{row, col} = genhurst(num1(startrows(row):startrows(row)+windowsize-1, col));
end
end
Here, I want to add date column (available as the 1st column in the indexdata) in the rolling window framework so that can get the rolling estimated values correponding to the particular date.
For your convenience, I have attached my sample datafile.
Please help me.
Thank you.

Answers (0)

Categories

Find more on Programming in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!