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
1c29970c
Commit
1c29970c
authored
Mar 08, 2013
by
Stéphane Adjemian
Browse files
Call merge method, added unitary tests.
parent
cefbf45a
Changes
1
Hide whitespace changes
Inline
Side-by-side
matlab/@dynSeries/subsasgn.m
View file @
1c29970c
...
...
@@ -45,6 +45,10 @@ if isa(A,'dynSeries') && isa(B,'dynSeries')
return
end
end
return
elseif
length
(
S
)
==
1
&&
isequal
(
S
.
type
,
'.'
)
A
=
merge
(
A
,
B
);
return
end
end
...
...
@@ -114,3 +118,45 @@ error('dynSeries::subsasgn: Wrong calling sequence!')
%
$
t
(
6
)
=
dyn_assert
(
ts1
.
data
,[
log
(
A
(
:
,
1
)),
A
(
:
,
2
),
log
(
A
(
:
,
3
))],
1e-15
);
%
$
T
=
all
(
t
);
%
@eof
:
3
%
@test
:
4
%
$
%
Define
a
datasets
.
%
$
A
=
rand
(
10
,
3
);
B
=
rand
(
10
,
3
);
%
$
%
$
%
Instantiate
two
dynSeries
object
.
%
$
ts1
=
dynSeries
(
A
,[],{
'
A1
';'
A2
';'
A3
'
},[]);
%
$
ts2
=
dynSeries
(
B
,[],{
'
B1
';'
B2
';'
B3
'
},[]);
%
$
%
$
%
Apply
the
logarithm
function
to
the
first
and
third
variables
.
%
$
ts1
.
A1
=
ts2
.
B1
;
%
$
%
$
%
Instantiate
a
time
series
object
.
%
$
%
$
t
(
1
)
=
dyn_assert
(
ts1
.
vobs
,
4
);
%
$
t
(
2
)
=
dyn_assert
(
ts1
.
nobs
,
10
);
%
$
t
(
3
)
=
dyn_assert
(
ts1
.
name
{
1
},
'
A1
'
);
%
$
t
(
3
)
=
dyn_assert
(
ts1
.
name
{
4
},
'
B1
'
);
%
$
T
=
all
(
t
);
%
@eof
:
4
%
@test
:
5
%
$
%
Define
a
datasets
.
%
$
A
=
rand
(
10
,
3
);
B
=
rand
(
10
,
3
);
%
$
%
$
%
Instantiate
two
dynSeries
object
.
%
$
ts1
=
dynSeries
(
A
,[],{
'
A1
';'
A2
';'
A3
'
},[]);
%
$
ts2
=
dynSeries
(
B
,[],{
'
A1
';'
B2
';'
B3
'
},[]);
%
$
%
$
%
Apply
the
logarithm
function
to
the
first
and
third
variables
.
%
$
ts1
.
A1
=
ts2
.
A1
;
%
$
%
$
%
Instantiate
a
time
series
object
.
%
$
%
$
t
(
1
)
=
dyn_assert
(
ts1
.
vobs
,
3
);
%
$
t
(
2
)
=
dyn_assert
(
ts1
.
nobs
,
10
);
%
$
t
(
3
)
=
dyn_assert
(
ts1
.
name
{
1
},
'
A1
'
);
%
$
t
(
4
)
=
dyn_assert
(
ts1
.
data
(
:
,
1
),
B
(
:
,
1
),
1e-15
);
%
$
t
(
5
)
=
dyn_assert
(
ts1
.
data
(
:
,
2
:
3
),
A
(
:
,
2
:
3
),
1e-15
);
%
$
T
=
all
(
t
);
%
@eof
:
5
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