Simulink.Parameter Value

87 ビュー (過去 30 日間)
Ayodeji
Ayodeji 2024 年 11 月 13 日 19:03
コメント済み: Ayodeji 2024 年 11 月 18 日 18:33
What should the parameter Value be in the model explorer when the Data type is a user defined bus structure?
  1 件のコメント
Ayodeji
Ayodeji 2024 年 11 月 18 日 18:33
I was able to copy the user defined bus structure from the external structure and rename the bus structure. Thanks.

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

回答 (1 件)

Sreeram
Sreeram 2024 年 11 月 15 日 6:27
Hi Ayodeji,
I assume that you mean how to add the value for the Simulink.Parameter object of Bus type so that it is reflected in the Model Explorer.
Here is an example on how to create a Simulink.Parameter object:
1. Create a struct object and assign fields as required:
Sinusoidal_MATLABStruct = struct;
Sinusoidal_MATLABStruct.Chirp = 0;
Sinusoidal_MATLABStruct.Sine = 0;
2. Create a Simulink.Parameter object and assign Value and other attributes as needed:
Sinusoidal_Param = Simulink.Parameter;
Sinusoidal_Param.Value = Sinusoidal_MATLABStruct;
Sinusoidal_Param.DataType = 'Bus: Sinusoidal';
Sinusoidal_Param.Complexity = 'real';
Sinusoidal_Param.CoderInfo.StorageClass = 'Auto';
This will add a parameter object ‘Sinusoidal_Param’ in the Base Workspace. You may drag and drop it to the Model Workspace if required.
You may read more about how to configure parameter values here:
I hope this helps.

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by