필터 지우기
필터 지우기

Get DataType from a Simulink Consant Block (datatype is propagated from the output)

조회 수: 1 (최근 30일)
I would like to get the datatype from a Constant block where the datatype is propagated from the output after update.
For example, block A's output is connected to a signal b (double). What is the command to get the datatype from A so it returns "double" and not "Inherit: Inherit from 'Constant value'"?
  댓글 수: 1
David
David 2023년 2월 17일
For anyone that needs this, the site below is useful for a short script that can be modified to find the blocks. It requires the model to be compiled, which is easy to achieve as long as you have set up "mex" in MATLAB.

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

답변 (1개)

Fangjun Jiang
Fangjun Jiang 2023년 2월 17일
Make sure your model can pass model update (no errors). See example below:
f14;%open the example model
f14([],[],[],'compile');
p=get_param('f14/u','CompiledPortDataTypes')
p = struct with fields:
Inport: [] Outport: {'double'} Enable: [] Trigger: [] State: [] LConn: [] RConn: [] Ifaction: [] Reset: [] Event: []
f14([],[],[],'term')
bdclose('f14')

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by