フィルターのクリア

In the bus object editor, can i specify the dimensions of a bus element as a variable read from the base workspace or the simulink moderl?

5 ビュー (過去 30 日間)
Eleni T
Eleni T 2022 年 11 月 10 日
編集済み: Eleni T 2022 年 11 月 24 日
Hello.
I have the bus object shown in the photo attached.. In one of the bus elements, i would like add the dimension as a variable that is specified in the based work space or in simulink. I get an error that this variable is not recognised. Does anyone know how to do this?

回答 (1 件)

Sai
Sai 2022 年 11 月 23 日
I understand that you are trying to use a variable created in workspace as a parameter to define the dimension of the data variable. You can use a variable from workspace as a parameter to the bus object, but the variable should be already loaded in the workspace or defined in the callbacks. You can do that by navigating as follows
Modelling-->Model Settings(drop down)-->Model Properties-->callbacks
In the callbacks you can define and declare the variable, click 'apply' and 'ok'
  3 件のコメント
Sai
Sai 2022 年 11 月 24 日
Once the variable is added in the PreLoadFcn callback, please close the model, re-open it and then run.
If the issue still persists, please share which parameter of the bus object you are trying to modify and also reproduction steps to produce the error?
Eleni T
Eleni T 2022 年 11 月 24 日
編集済み: Eleni T 2022 年 11 月 24 日
I am trying to modify the dimension of parameter 'Data' of the bus object.
It doesn't let me to add anything else apart from positive numerical values. When i add the variable, it is not saved and i get this red warning, as in the photo below.

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

カテゴリ

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

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by