Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
...@@ -55,8 +55,9 @@ function autocov = nanautocovariance(data,order) ...@@ -55,8 +55,9 @@ function autocov = nanautocovariance(data,order)
n = size(data,2); n = size(data,2);
missing = isanynan(data); missing = isanynan(data);
autocov = nan(n, n, order);
order = min(size(data,1)-2,order); order = min(size(data,1)-2,order);
autocov = zeros(n, n, order); autocov(:, :, 1:order)=0;
for lag=1:order for lag=1:order
if missing if missing
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment