From 4832c0dd42d9d9d7402c68e28c40615c51376b0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Charybdis=29?= <stepan@adjemian.eu> Date: Thu, 23 Jan 2020 20:12:05 +0100 Subject: [PATCH] Small cosmetic/efficiency changes. --- src/@dseries/subsasgn.m | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/@dseries/subsasgn.m b/src/@dseries/subsasgn.m index 89c1da7..50f5038 100644 --- a/src/@dseries/subsasgn.m +++ b/src/@dseries/subsasgn.m @@ -48,8 +48,8 @@ switch length(S) error('dseries::subsasgn: (MATLAB/Octave''s regular expressions) Check opening and closing square brackets!') end % Loops and regular expressions are not compatible - if length(idArobase) && length(idBracket.open) - error(['dseries::subsasgn: You cannot use implicit loops and regular expressions in the same rule!']) + if ~isempty(idArobase) && ~isempty(idBracket.open) + error('dseries::subsasgn: You cannot use implicit loops and regular expressions in the same rule!') end if ~isempty(idArobase) elements = build_list_of_variables_with_loops({}, idArobase, element, {}); @@ -76,7 +76,7 @@ switch length(S) 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}}; + B.name(i) = S(1).subs(i); B.tex(i) = {name2tex(S(1).subs{i})}; else % Rename variable and change its content. @@ -152,7 +152,7 @@ switch length(S) A.tex = name2tex(A.name); if isempty(A.dates) if isempty(A.dates.freq) - init = dates('1Y') + init = dates('1Y'); else init = dates(A.dates.freq, 1, 1); end -- GitLab