Rewrote header.
parent
71045299a4
commit
1f80af75c1
|
@ -1,33 +1,12 @@
|
||||||
function dd = unique(dd) % --*-- Unitary tests --*--
|
function B = unique(A) % --*-- Unitary tests --*--
|
||||||
|
|
||||||
% unique method for dates class.
|
% Overloads the unique function for dates objects.
|
||||||
|
%
|
||||||
%@info:
|
% INPUTS
|
||||||
%! @deftypefn {Function File} {@var{a} =} unique (@var{a})
|
% o A dates object.
|
||||||
%! @anchor{dates/unique}
|
%
|
||||||
%! @sp 1
|
% OUTPUTS
|
||||||
%! Unique method for the Dynare dates class (removes repetitions).
|
% o B dates object (a copy of A without repetitions).
|
||||||
%! @sp 2
|
|
||||||
%! @strong{Inputs}
|
|
||||||
%! @sp 1
|
|
||||||
%! @table @ @var
|
|
||||||
%! @item a
|
|
||||||
%! Object instantiated by @ref{dates}.
|
|
||||||
%! @end table
|
|
||||||
%! @sp 2
|
|
||||||
%! @strong{Outputs}
|
|
||||||
%! @sp 1
|
|
||||||
%! @table @ @var
|
|
||||||
%! @item a
|
|
||||||
%! Object instantiated by @ref{dates}.
|
|
||||||
%! @end table
|
|
||||||
%! @sp 2
|
|
||||||
%! @strong{This function is called by:}
|
|
||||||
%! @sp 2
|
|
||||||
%! @strong{This function calls:}
|
|
||||||
%!
|
|
||||||
%! @end deftypefn
|
|
||||||
%@eod:
|
|
||||||
|
|
||||||
% Copyright (C) 2012-2013 Dynare Team
|
% Copyright (C) 2012-2013 Dynare Team
|
||||||
%
|
%
|
||||||
|
@ -46,17 +25,19 @@ function dd = unique(dd) % --*-- Unitary tests --*--
|
||||||
% You should have received a copy of the GNU General Public License
|
% You should have received a copy of the GNU General Public License
|
||||||
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
|
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
if ~isa(dd,'dates')
|
if ~isa(A,'dates')
|
||||||
error(['dates::unique: Input argument ' inputname(1) ' has to be a dates object.'])
|
error(['dates::unique: Input argument ' inputname(1) ' has to be a dates object.'])
|
||||||
end
|
end
|
||||||
|
|
||||||
if dd.ndat==1
|
if A.ndat==1
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
[tmp,id,jd] = unique(dd.time,'rows');
|
B = A;
|
||||||
dd.time = dd.time(sort(id),:);
|
|
||||||
dd.ndat = size(dd.time,1);
|
[tmp,id,jd] = unique(A.time,'rows');
|
||||||
|
B.time = A.time(sort(id),:);
|
||||||
|
B.ndat = size(B.time,1);
|
||||||
|
|
||||||
%@test:1
|
%@test:1
|
||||||
%$ % Define some dates
|
%$ % Define some dates
|
||||||
|
|
Loading…
Reference in New Issue