Model workspace input data from functions

3 ビュー (過去 30 日間)
katherine keogh
katherine keogh 2021 年 1 月 7 日
回答済み: Nitin Kapgate 2021 年 1 月 11 日
So in the past I made a bunch of functions in Simulink and then put loads of the input variables in the model workspace. Then I have come back to the model after christmas and started adding more functions, which require numbers from this workspace, except I can 't seem to get Matlab to recognise the numbers in the model workspace are the inputs of the new functions. Can anyone help?
  1 件のコメント
Mathieu NOE
Mathieu NOE 2021 年 1 月 7 日
hi
so what in the new functions would not work with the workspace init data that previuously worked ?
maybe you'll have to share the m and simulink code (or a dumy one)

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

回答 (1 件)

Nitin Kapgate
Nitin Kapgate 2021 年 1 月 11 日
You can use a Simulink.ModelWorkspace object to Interact with the model workspace of a model programmatically.
You can refer to this example which demonstrates creation, modification and query of a variable in the model workspace of a model.

カテゴリ

Help Center および File ExchangeProgrammatic Model Editing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by