How to run Matlab Function in a triggered subsystem in Simulink

조회 수: 2 (최근 30일)
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

채택된 답변

Sindhu Yerragunta
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개)

카테고리

Help CenterFile Exchange에서 Subsystems에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by