필터 지우기
필터 지우기

How does the function element and function element call block work?

조회 수: 1 (최근 30일)
Svenh
Svenh 2023년 10월 28일
답변: Raj 2023년 11월 16일
I want to call a function which is in an subsystem from outside that subsystem therfore i would like to use the function element and element call block but i dont really understand from the documentation how i have to setup the port name since the function element block never seems to see the function.
Thank you very much

채택된 답변

Raj
Raj 2023년 11월 16일
Hello Svenh,
In Simulink, the Function Element and Element Call blocks are not used for calling functions within subsystems. The Function Element block lets you call a Simulink function from one referenced model using a function caller in another referenced model.
To call a function that resides in a subsystem from outside the subsystem in Simulink, you can follow these steps:
  1. Inside the subsystem, add Inport and Outport blocks to represent the function inputs and outputs and connect the necessary signals to it.
  2. Place Inport blocks outside the subsystem for function inputs and connect them to the corresponding Inport blocks inside the subsystem.
  3. Place Outport blocks outside the subsystem for function outputs and connect them to the corresponding Outport blocks inside the subsystem.
With this, you can call the function defined in the subsystem from outside the subsystem. The Inport blocks represent the function inputs, and the Outport blocks represent the function outputs.
Additionally you can refer to the documentation for a better understanding-
I hope this resolves your query!

추가 답변 (0개)

카테고리

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

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by