필터 지우기
필터 지우기

How to reduce the execution time for Input/Output ports in Simulink?

조회 수: 1 (최근 30일)
Antonio Carlo Bertolino
Antonio Carlo Bertolino 2020년 7월 8일
답변: Fangjun Jiang 2020년 7월 10일
Hello,
I just installed the R2020a version of MATLAB&Simulink and I profiled my Simulink model.
From the profiler report it appeared that, among other sources, a not negligible amount of time is taken by the Input and Output ports of various subsystems.
What is it due to? Is it possible to reduce this time in order to speed up the simulation?
Thank you,
Antonio
  댓글 수: 2
Fangjun Jiang
Fangjun Jiang 2020년 7월 8일
Are they atomic subsystems?
Antonio Carlo Bertolino
Antonio Carlo Bertolino 2020년 7월 10일
They are the ports of a "If Action Subsystem". This subsystem does not have the option "Treat as an atomic unit" checked in the Block parameters panel.

댓글을 달려면 로그인하십시오.

답변 (1개)

Fangjun Jiang
Fangjun Jiang 2020년 7월 10일
An atomic subsystem will have to update its Inport and Outport at every simulation step while virtual subsystems don't need to do that. If the time took to do those Inport and Outport update has become significant, re-examine and consider changeing atomic subsystems to be virtual. Many times, I found users don't necessarily understand the difference and subsystems were made atomic by accident.
Action Subsystems are atomic subsystems by definition. You can still consider using alternatives such as conditional brahching using Switch block.
The boundary of virtual subsystem don't exist when simulating or for code generation, while the boundary of atomic subsystems are required to update at every simulation step. If subsystems are made atomic unnecessarily or by mistake, the simulation speed might suffer slightly and the result might differ.

카테고리

Help CenterFile Exchange에서 Schedule Model Components에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by