diff --git a/matlab/@dynSeries/extract.m b/matlab/@dynSeries/extract.m index d51e08da7..019b82aee 100644 --- a/matlab/@dynSeries/extract.m +++ b/matlab/@dynSeries/extract.m @@ -66,7 +66,7 @@ for i=1:nargin-1 while ~isempty(expression) [token, expression] = strtok(expression,','); candidate = [VariableName(1:idArobase(1)-1), token, VariableName(idArobase(2)+1:end)]; - id = strmatch(candidate,B.name,'exact'); + id = find(strcmp(candidate,B.name)); if isempty(id) error(['dynSeries::extract: Variable ''' candidate ''' does not exist in dynSeries object ''' inputname(1) '''!']) else @@ -88,7 +88,7 @@ for i=1:nargin-1 while ~isempty(expression_2) [token_2, expression_2] = strtok(expression_2,','); candidate = [VariableName(1:idArobase(1)-1), token_1, VariableName(idArobase(2)+1:idArobase(3)-1), token_2, VariableName(idArobase(4)+1:end)]; - id = strmatch(candidate,B.name,'exact'); + id = find(strcmp(candidate,B.name)); if isempty(id) error(['dynSeries::extract: Variable ''' candidate ''' does not exist in dynSeries object ''' inputname(1) '''!']) else @@ -114,7 +114,7 @@ end % Get indices of the selected variables idVariableName = NaN(length(VariableName_),1); for i = 1:length(idVariableName) - idx = strmatch(VariableName_{i},B.name,'exact'); + idx = find(strcmp(VariableName_{i},B.name)); if isempty(idx) error(['dynSeries::extract: Variable ' VariableName_{i} ' is not a member of ' inputname(1) '!']) end diff --git a/matlab/@dynSeries/pop.m b/matlab/@dynSeries/pop.m index 371374eff..cb86737e5 100644 --- a/matlab/@dynSeries/pop.m +++ b/matlab/@dynSeries/pop.m @@ -45,7 +45,7 @@ function [ts,id] = pop(ts,a) % --*-- Unitary tests --*-- % You should have received a copy of the GNU General Public License % along with Dynare. If not, see . -id = strmatch(a,ts.name,'exact'); +id = find(strcmp(a,ts.name)); if isempty(id) id = 0; return diff --git a/matlab/@dynSeries/rename.m b/matlab/@dynSeries/rename.m index 9ba5186af..b8903738a 100644 --- a/matlab/@dynSeries/rename.m +++ b/matlab/@dynSeries/rename.m @@ -21,7 +21,7 @@ if ~ischar(old) || ~ischar(new) error(['dynSeries::rename: Input arguments ''' inputname(2) ''' and ''' inputname(3) ''' have to be strings!']) end -idname = strmatch(old,ts.name,'exact'); +idname = find(strcmp(old,ts.name)); if isempty(idname) error(['dynSeries::rename: Variable ' old ' is unknown in dynSeries object ' inputname(1) '!']) diff --git a/matlab/@dynSeries/subsasgn.m b/matlab/@dynSeries/subsasgn.m index fe655bd85..00586c8b5 100644 --- a/matlab/@dynSeries/subsasgn.m +++ b/matlab/@dynSeries/subsasgn.m @@ -84,7 +84,7 @@ switch length(S) for i = 1:B.vobs if ~isequal(S(1).subs{i},B.name{i}) % Rename a variable. - id = strmatch(S(1).subs{i},A.name); + id = find(strcmp(S(1).subs{i},A.name)); if isempty(id) % Add a new variable a change its name. B.name(i) = {S(1).subs{i}}; @@ -118,7 +118,7 @@ switch length(S) % Single variable selection. if ~isequal(S(1).subs,B.name{1}) % Rename a variable. - id = strmatch(S(1).subs,A.name); + id = find(strcmp(S(1).subs,A.name)); if isempty(id) % Add a new variable a change its name. B.name(1) = {S(1).subs}; diff --git a/matlab/@dynSeries/subsref.m b/matlab/@dynSeries/subsref.m index 72ffd4adf..bfac6274b 100644 --- a/matlab/@dynSeries/subsref.m +++ b/matlab/@dynSeries/subsref.m @@ -139,7 +139,7 @@ switch S(1).type B = feval(S(1).subs,A,S(2).subs{:}); S = shiftS(S); otherwise % Extract a sub-object by selecting one variable. - ndx = strmatch(S(1).subs,A.name,'exact'); + ndx = find(strcmp(S(1).subs,A.name)); if ~isempty(ndx) B = dynSeries(); B.data = A.data(:,ndx); diff --git a/matlab/@dynSeries/tex_rename.m b/matlab/@dynSeries/tex_rename.m index 5cfa27fc4..28a2de480 100644 --- a/matlab/@dynSeries/tex_rename.m +++ b/matlab/@dynSeries/tex_rename.m @@ -32,7 +32,7 @@ assert(ischar(newtex), 'dynSeries::tex_rename: the newtex name must be a string' if nargin == 2 idname = 1; else - idname = strmatch(name, ts.name, 'exact'); + idname = find(strcmp(name, ts.name)); if isempty(idname) error(['dynSeries::tex_rename: Variable ' name ' is unknown in dynSeries object ' inputname(1) '!']) end