Commit 628b0356 authored by Sébastien Villemot's avatar Sébastien Villemot

@dseries/{first,last}observedperiod.m: MATLAB R2009b compatibility fix

prod() does not accept logical arrays, need to explicitly convert to doubles.
parent ddda1e8e
Pipeline #1868 passed with stage
in 1 minute and 35 seconds
......@@ -26,7 +26,7 @@ function d = firstobservedperiod(o) % --*-- Unitary tests --*--
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
b = ~isnan(o);
c = find(prod(b, 2));
c = find(prod(double(b), 2));
if isempty(c)
error('No overlapping non-NaN data points found in dseries.');
......
......@@ -26,7 +26,7 @@ function d = lastobservedperiod(o) % --*-- Unitary tests --*--
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
b = ~isnan(o);
c = find(prod(b, 2));
c = find(prod(double(b), 2));
if isempty(c)
error('No overlapping non-NaN data points found in dseries.');
end
......
Markdown is supported
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