From a5ea76d58cb60b02047dab8fbf748999a3257b7b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Charybdis=29?=
 <stephane.adjemian@univ-lemans.fr>
Date: Fri, 27 Jun 2014 22:29:57 +0200
Subject: [PATCH] Do not issue an error message if the dseries appearing in the
 recursive/static expression do have common names.

---
 matlab/utilities/dseries/from.m | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/matlab/utilities/dseries/from.m b/matlab/utilities/dseries/from.m
index 9351a02e3e..a78c953083 100644
--- a/matlab/utilities/dseries/from.m
+++ b/matlab/utilities/dseries/from.m
@@ -219,10 +219,10 @@ for i=1:number_of_variables
         end
         if i>1
             if ismember(var.name,variable_names)
-                error('dseries::from: All the dseries objects should contain variables with different names!')
-            else
-                variable_names(i) = {var.name{1}};
+                % Locally change variable name.
+                var = var.rename(var.name{1},get_random_string(20));
             end
+            variable_names(i) = {var.name{1}};
         else
             variable_names(i) = {var.name{1}};
         end
@@ -244,7 +244,7 @@ for i=1:number_of_variables
         eval(sprintf('%s = var;',current_variable));
     end
 end
-
+variable_names
 % Get the name of the assigned variable (with time index)
 assignedvariablename = regexpi(EXPRESSION(1:equal_id-1), '\w*\(t\)|\w*\(t\-\d\)|\w*\(t\+\d\)|\w*\.\w*\(t\)|\w*\.\w*\(t\-\d\)|\w*\.\w*\(t\+\d\)','match');
 if isempty(assignedvariablename)
-- 
GitLab