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

8 ビュー (過去 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 件のコメント
Felipe Padua
Felipe Padua 2022 年 7 月 16 日
Yes, it's very strange.
Paul
Paul 2022 年 7 月 16 日
Just tested 2021b, and SrcWorkspace works. Good to know.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

タグ

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by