Skip to content
Snippets Groups Projects
Verified Commit 0061f081 authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

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

prod() does not accept logical arrays, need to explicitly convert to doubles.
parent 69541132
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment