Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
dseries
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dynare
dseries
Commits
6ef181d1
Commit
6ef181d1
authored
9 years ago
by
Houtan Bastani
Browse files
Options
Downloads
Patches
Plain Diff
add batch tex_rename
parent
2f57168c
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/@dseries/tex_rename.m
+28
-4
28 additions, 4 deletions
src/@dseries/tex_rename.m
with
28 additions
and
4 deletions
src/@dseries/tex_rename.m
+
28
−
4
View file @
6ef181d1
function
ts
=
tex_rename
(
ts
,
varargin
)
% --*-- Unitary tests --*--
% Copyright (C) 2013 Dynare Team
% Copyright (C) 2013
-2015
Dynare Team
%
% This file is part of Dynare.
%
...
...
@@ -21,14 +21,17 @@ assert(nargin <= 3, 'dseries::tex_rename: accepts at most three args');
if
nargin
==
2
newtexname
=
varargin
{
1
};
assert
(
vobs
(
ts
)
==
1
,
[
'dseries::tex_rename: with one argument, the dseries contain only one variable.'
]);
assert
(
vobs
(
ts
)
==
1
||
vobs
(
ts
)
==
length
(
newtexname
),
...
'dseries::tex_rename: with one argument, the dseries contain only one variable.'
);
else
newtexname
=
varargin
{
2
};
name
=
varargin
{
1
};
assert
(
ischar
(
name
),
'dseries::tex_rename: second input argument (name) must be a string'
);
end
assert
(
ischar
(
newtexname
),
'dseries::tex_rename: third input argument (newtexname) name must be a string'
);
assert
(
ischar
(
newtexname
)
||
(
iscellstr
(
newtexname
)
&&
length
(
newtexname
)
==
vobs
(
ts
)),
...
[
'dseries::tex_rename: third input argument (newtexname) name must either be a string'
...
' or a cell array of strings with the same number of entries as varibles in the dseries'
]);
if
nargin
==
2
idname
=
1
;
...
...
@@ -39,7 +42,11 @@ else
end
end
ts
.
tex
(
idname
)
=
{
newtexname
};
if
iscellstr
(
newtexname
)
ts
.
tex
=
newtexname
;
else
ts
.
tex
(
idname
)
=
{
newtexname
};
end
%@test:1
%$ t = zeros(8,1);
...
...
@@ -86,3 +93,20 @@ ts.tex(idname) = {newtexname};
%$
%$ T = all(t);
%@eof:2
%@test:3
%$ t = zeros(2,1);
%$ ts = dseries(rand(3,3));
%$ try
%$ ts = ts.tex_rename({'Output','\\Delta Y_t','\\theta_{-1}'});
%$ t(1) = 1;
%$ catch
%$ t = 0;
%$ end
%$
%$ if length(t)>1
%$ t(2) = dassert(ts.tex,{'Output','\\Delta Y_t','\\theta_{-1}'});
%$ end
%$
%$ T = all(t);
%@eof:3
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment