What Happened to the SrcWorkspace Name-Value Input to the sim() Command?

11 visualizaciones (últimos 30 días)
Paul
Paul el 31 de Ag. de 2021
Comentada: Paul el 16 de Jul. de 2022
The SrcWorkspace Name-Value pair argument to the sim() command seems to have disappeared going from 2020b to 2021a. I searched the 2021a Release Notes and could find no mention of its removal. Did I miss that in the ReleaseNotes? More importantly, how does one implement that functionality now?

Respuestas (2)

Paul
Paul el 31 de Ag. de 2021
Looks like one has to use a Simulink.SimulationInput object as the input to the sim() command.
  1 comentario
Tamas Rozsa
Tamas Rozsa el 7 de En. de 2022
Editada: Tamas Rozsa el 7 de En. de 2022
True.
In fact, 'SrcWorkspace' is also buggy and does not work well with data dictionaries (see e.g. https://www.mathworks.com/matlabcentral/answers/367223-using-srcworkspace-with-data-dictionaries), so Simulink.SimulationInput seems to be the way to go.
Another reason to avoid 'SrcWorkspace' might be that it seems to have issues also when using with the parallel computing command 'parfor' (see e.g. https://www.mathworks.com/matlabcentral/answers/94215-how-can-i-set-the-source-workspace-to-caller-when-using-a-the-sim-command-from-a-function-in-simul).

Iniciar sesión para comentar.


Felipe Padua
Felipe Padua el 16 de Jul. de 2022
It's present in R2022a documentation.
  3 comentarios
Paul
Paul el 16 de Jul. de 2022
Just tested 2021b, and SrcWorkspace works. Good to know.

Iniciar sesión para comentar.

Categorías

Más información sobre Simulink en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by