- Use a Constant Block: Instead of initializing the signal directly, use a Constant block in your model to set the initial values for the bus signal. Configure the Constant block to output a bus signal by specifying the bus object as its data type.
- Initialize in a MATLAB Function Block: You can initialize the bus signal within a MATLAB Function block. This block can output the required bus structure, and you can set its initial values programmatically.
- Use the Bus Assignment Block: If you need to set only specific fields of the bus, you can use a Bus Assignment block to assign initial values to certain fields of the bus signal.
Bus Signal Initialization Error
4 ビュー (過去 30 日間)
古いコメントを表示
I try to initialize simulink signal which data type is Bus Object. After many trials I filled the "initvalue" field with struct('field', value, 'field', value) syntax with real values and fields. But it give me error while simulation which is "Signal object currently cannot support initial value on bus signal". I use matlab 2018b.
0 件のコメント
回答 (1 件)
Vidhi Agarwal
2024 年 11 月 4 日 3:42
I understand you are facing issue in initializing simulink signal. Below are the steps that may help you in resolving the issue.
You can also consider upgrading to a newer version of MATLAB.
Hope that helps!
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!