Skip to content
Snippets Groups Projects
Commit d898f760 authored by Stéphane Adjemian's avatar Stéphane Adjemian
Browse files

Fixed merge of empty dseries.

parent 40263275
Branches
No related tags found
No related merge requests found
......@@ -32,13 +32,24 @@ function q = merge(o, p, rewritewithnans) % --*-- Unitary tests --*--
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
if ~isdseries(p)
if ~isdseries(p) || ~isdseries(o)
error('dseries::merge: Both inputs must be dseries objects!')
end
if isempty(o) && ~isempty(p)
q = p;
return
elseif ~isempty(o) && isempty(p)
q = o;
return
elseif isempty(o) && isempty(p)
q = p;
return
end
if ~isequal(frequency(o), frequency(p))
if isempty(inputname(1))
error(['dseries::merge: Cannot merge dseries objects (frequencies are different)!'])
error('dseries::merge: Cannot merge dseries objects (frequencies are different)!')
else
error(['dseries::merge: Cannot merge ' inputname(1) ' and ' inputname(2) ' (frequencies are different)!'])
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment