@@ -140,20 +140,17 @@ function runLiveScript_basic(~)
140140
141141 % This is the most basic simulation where nothing interesting happens,
142142 % but this ensures that everything in the script works fine.
143- evalin( " base " , " PowerSplitHEV_SpeedTracking_testcase_basic" );
143+ PowerSplitHEV_SpeedTracking_testcase_basic
144144
145145 close all
146146 bdclose all
147147end % function
148148
149149function runLiveScript_highSpeed(~)
150150%% Check that the script runs without any warnings or errors.
151-
152151 close all
153152 bdclose all
154-
155- evalin(" base" , " PowerSplitHEV_SpeedTracking_testcase_highSpeed" );
156-
153+ PowerSplitHEV_SpeedTracking_testcase_highSpeed
157154 close all
158155 bdclose all
159156end % function
@@ -166,42 +163,51 @@ function runLiveScript_Accelerate_Decelerate(~)
166163 close all
167164 bdclose all
168165
169- evalin(" base" , " PowerSplitHEV_SpeedTracking_Accelerate_Decelerate" );
166+ % If script loads some variables to the base workspace
167+ % (for example by calling a function which explicitly does so with assignin),
168+ % the script must be explicitly evaluated in the base workspace.
169+ evalin(" base" , " PowerSplitHEV_SpeedTracking_Accelerate_Decelerate" )
170170
171171 close all
172172 bdclose all
173173end % function
174174
175175function runLiveScript_SimpleDrivePattern(~)
176176%% Check that the script runs without any warnings or errors.
177-
178177 close all
179178 bdclose all
180179
181- evalin(" base" , " PowerSplitHEV_SpeedTracking_SimpleDrivePattern" );
180+ % If script loads some variables to the base workspace
181+ % (for example by calling a function which explicitly does so with assignin),
182+ % the script must be explicitly evaluated in the base workspace.
183+ evalin(" base" , " PowerSplitHEV_SpeedTracking_SimpleDrivePattern" )
182184
183185 close all
184186 bdclose all
185187end % function
186188
187189function runLiveScript_FTP75(~)
188190%% Check that the script runs without any warnings or errors.
189-
190191 close all
191192 bdclose all
192193
193- evalin(" base" , " PowerSplitHEV_SpeedTracking_FTP75" );
194+ % If script loads some variables to the base workspace
195+ % (for example by calling a function which explicitly does so with assignin),
196+ % the script must be explicitly evaluated in the base workspace.
197+ evalin(" base" , " PowerSplitHEV_SpeedTracking_FTP75" )
194198
195199 close all
196200 bdclose all
197201end % function
198202
199203function runLiveScript_main_script(~)
200204%% Check that the script runs without any warnings or errors.
201-
202205 close all
203206 bdclose all
204207
208+ % If script loads some variables to the base workspace
209+ % (for example by calling a function which explicitly does so with assignin),
210+ % the script must be explicitly evaluated in the base workspace.
205211 evalin(" base" , " PowerSplitHEV_SpeedTracking_main_script" )
206212
207213 close all
@@ -216,6 +222,9 @@ function runLiveScript_sweep(~)
216222 close all
217223 bdclose all
218224
225+ % If script loads some variables to the base workspace
226+ % (for example by calling a function which explicitly does so with assignin),
227+ % the script must be explicitly evaluated in the base workspace.
219228 evalin(" base" , " PowerSplitHEV_SpeedTracking_sweep" )
220229
221230 close all
0 commit comments