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

조회 수: 11 (최근 30일)
Paul
Paul 2021년 8월 31일
댓글: Paul 2022년 7월 16일
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?

답변 (2개)

Paul
Paul 2021년 8월 31일
Looks like one has to use a Simulink.SimulationInput object as the input to the sim() command.
  댓글 수: 1
Tamas Rozsa
Tamas Rozsa 2022년 1월 7일
편집: Tamas Rozsa 2022년 1월 7일
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).

댓글을 달려면 로그인하십시오.


Felipe Padua
Felipe Padua 2022년 7월 16일
It's present in R2022a documentation.
  댓글 수: 3
Paul
Paul 2022년 7월 16일
Just tested 2021b, and SrcWorkspace works. Good to know.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Simulink에 대해 자세히 알아보기

태그

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by