Simulink Unable to Identify Variable in Base Workspace
21 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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
variable 'Tsim'.
however, Tsim is in the base workspace so im not sure what is going wrong here, this file also runs fine matlab 2012
0 comentarios
Respuestas (2)
Sebastian Castro
el 2 de Jun. de 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', ... )
- Sebastian
4 comentarios
Arihant Sureka
el 19 de Sept. de 2018
Editada: Sebastian Castro
el 19 de Sept. de 2018
Hi Sebastian
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.
Thanks
2 comentarios
Sebastian Castro
el 19 de Sept. de 2018
Your question is on parsim and not sim, which are different functions. As the error message suggests, parsim does not have a SrcWorkspace property to configure.
Looking at the documentation, and depending on how your data is set up, you either want to use AttachedFiles or TransferBaseWorkspaceVariables.
- Sebastian
Arihant Sureka
el 21 de Sept. de 2018
Hi Sebastien
The thing worked. Thanks for the help but since the Matlab 2017b has Bugs I had to clear the previously created slprj Folder and stuff.
Thanks and cheers!
Ver también
Categorías
Más información sobre Dependency Analysis en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!