How to run Matlab Function in a triggered subsystem in Simulink
1 回表示 (過去 30 日間)
古いコメントを表示
Alberto Bolzoni
2017 年 8 月 3 日
回答済み: Sindhu Yerragunta
2017 年 8 月 7 日
Good evening.
I am running a simulation in Simulink/Simscape with a fundamental sample time (set in the Powergui block) equal to 5e-6 seconds.
Then in the model I need to run a certain code each 5e-3 seconds; I tryed to make it with a triggered subsystem containing the MATLAB Function block where the code is written, but I get an error message. I also tried to latch the inputs but still it does not work.
The main model is this one
while the triggered subsystem is this one
Finally, this is the error message
.
Thank you for your kind help.
Alberto
0 件のコメント
採用された回答
Sindhu Yerragunta
2017 年 8 月 7 日
Hi Alberto,
From the error message I understand that the issue is due to having different sample times for 'Boost_Converter2/Subsystem/Out1' and 'Boost_Converter2/DC-DC Boost/Sum1'. This can be resolved by keeping a Rate Trasition Block between these two ports.
For further information on Rate Trasition Block please refer the following link,
If you do not want to change your model, you can change the 'Multitask rate trasition' option in 'Configuration Parameters--> Diagnostics--> Sample Time' to warning.
Hope this resolves the issue.
-Sindhu
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Subsystems についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!