Simulink Unable to Identify Variable in Base Workspace
76 views (last 30 days)
I am running a program which calls Simulink, however when simulink gets called I get this error:
Error using Run_Sim (line 39)
Error evaluating expression 'Tsim' for 'StopTime' specified in the Configuration
Parameters dialog for block diagram 'New_model_working_plecs_2012b': Undefined function or
however, Tsim is in the base workspace so im not sure what is going wrong here, this file also runs fine matlab 2012
Sebastian Castro on 2 Jun 2016
Are you calling the command from inside a MATLAB function?
If so, you need to make sure to tell the sim command to use the current caller's (the function's) workspace.
simout = sim('modelName','SrcWorkspace','current', ... )
Arihant Sureka on 19 Sep 2018
Edited: Sebastian Castro on 19 Sep 2018
The Version is Matlab 2017b and still the Problem persists. I have already defined my model properties in the base Workspace but Simulink is not able to capture it. Also, this command line
simOut = parsim(simIn,'SrcWorkspace','current');
gives an error
'Invalid parameter 'SrcWorkspace' specified'.
Please guide further as there isn#t any answer available anywhere.