Commit d56bba72 authored by Marco Ratto's avatar Marco Ratto
Browse files

autocov is initialized NaN with the original order and then only loop up to...

autocov is initialized NaN with the original order and then only loop up to updted order compatible with sample size.
parent 15ab8578
......@@ -55,8 +55,9 @@ function autocov = nanautocovariance(data,order)
n = size(data,2);
missing = isanynan(data);
autocov = nan(n, n, order);
order = min(size(data,1)-2,order);
autocov = zeros(n, n, order);
autocov(:, :, 1:order)=0;
for lag=1:order
if missing
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment