Methods of moments: compatibility fix for MATLAB < R2015a

The mean(…, 'omitnan') syntax does not exist before R2015a. Use nanmean
instead (either provided by the statistics toolbox, or by our fallback under
matlab/missing/stats/).
time-shift
Sébastien Villemot 2021-01-19 15:32:06 +01:00
parent 4944a711db
commit f81b330f14
No known key found for this signature in database
GPG Key ID: 2CECE9350ECEBE4A
1 changed files with 1 additions and 1 deletions

View File

@ -59,7 +59,7 @@ for jm = 1:options_mom_.mom.mom_nbr
end
end
% We replace NaN (due to leads and lags and missing values) with the corresponding mean
if isoctave
if isoctave || matlab_ver_less_than('8.5')
dataMoments(jm,1) = nanmean(m_data_tmp);
else
dataMoments(jm,1) = mean(m_data_tmp,'omitnan');