필터 지우기
필터 지우기

Set ports properties from Level2-M-File

조회 수: 4 (최근 30일)
Bolivar
Bolivar 2013년 1월 28일
댓글: Davide Vertuani 2021년 9월 17일
Hallo,
I'm looking on how to write a Level 2 M-File for a simulink block. both inputs port get frame data. In fact i've got two Imput ports and three Outputs. When i set Imput ports Mode to 'Inherited', and then register the SetInputPortSamplingMode methode, the program generate error like "too many ouputs ports" two of output ports deliver frame sample. How can i fix that?? Do the SetInputPortSamplingMode has to define output ports sampling mode as well? My SetInputPortSamplingMode methode look as follow:
function setInPortSamMode (block)
block.InputPort(1).SamplingMode = 'frame';
block.InputPort(2).SamplingMode = 'frame';
block.OutputPort(1).SamplingMode = 'frame';
block.OutputPort(2).SamplingMode = 'frame';
thanks for helping me!
Bolivar

답변 (1개)

Kaustubha Govind
Kaustubha Govind 2013년 1월 28일
Yes, you do have to specify the output port sampling modes as well. Also, your setInPortSamMode doesn't have the correct prototype. According to the documentation, you need:
function setInPortSamMode(block, idx, fd)
  댓글 수: 1
Davide Vertuani
Davide Vertuani 2021년 9월 17일
The link to the documentation page is broken.
More detailed / extensive documentation about this argument (or generally any documentation about S-functions) would be more than welcome. One is faced with errors during development and has no documentation other than Q&As here and in StackOverflow to rely on.

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

카테고리

Help CenterFile Exchange에서 Block and Blockset Authoring에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by