Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Dóra Kocsis
dynare
Commits
0108a94c
Commit
0108a94c
authored
Jun 17, 2013
by
Stéphane Adjemian
Browse files
Added unitary test in @dynSeries/align method.
parent
d23cd527
Changes
1
Hide whitespace changes
Inline
Side-by-side
matlab/@dynSeries/align.m
View file @
0108a94c
...
...
@@ -120,4 +120,36 @@ end
%
$
t
(
5
)
=
dyn_assert
(
ts2
.
data
,[
B
;
NaN
(
4
,
2
)],
1e-15
);
%
$
end
%
$
T
=
all
(
t
);
%
@eof
:
1
\ No newline at end of file
%
@eof
:
1
%
@test
:
2
%
$
%
Define
a
datasets
.
%
$
A
=
rand
(
8
,
3
);
B
=
rand
(
7
,
2
);
%
$
%
$
%
Define
names
%
$
A_name
=
{
'
A1
';'
A2
';'
A3
'
};
%
$
B_name
=
{
'
B1
';'
B2
'
};
%
$
%
$
%
Define
initial
dates
%
$
A_init
=
'
1990
Q1
'
;
%
$
B_init
=
'
1990
Q1
'
;
%
$
%
$
%
Instantiate
two
dynSeries
objects
%
$
ts1
=
dynSeries
(
A
,
A_init
,
A_name
);
%
$
ts2
=
dynSeries
(
B
,
B_init
,
B_name
);
%
$
%
$
try
%
$
[
ts1
,
ts2
]
=
align
(
ts1
,
ts2
);
%
$
t
(
1
)
=
1
;
%
$
catch
%
$
t
(
1
)
=
0
;
%
$
end
%
$
%
$
if
t
(
1
)
%
$
t
(
2
)
=
dyn_assert
(
ts1
.
nobs
,
ts2
.
nobs
);
%
$
t
(
3
)
=
dyn_assert
(
ts1
.
init
==
ts2
.
init
,
1
);
%
$
t
(
4
)
=
dyn_assert
(
ts1
.
data
,
A
,
1e-15
);
%
$
t
(
5
)
=
dyn_assert
(
ts2
.
data
,[
B
;
NaN
(
1
,
2
)],
1e-15
);
%
$
end
%
$
T
=
all
(
t
);
%
@eof
:
2
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment