build a output.dimension since inputport.data
조회 수: 1 (최근 30일)
이전 댓글 표시
I have a s-function that it must to build the dimension of outputport with the data of inputport.
Example:
if the inputport receive 3 ( inputport(1).Data==3 ) then the dimension of outputport will be 8 x 3 ( outputport(1).Dimension=[ 8 3] ).
I don`t know if it`s posible????...
i don`t know how ???
Please helpme.............thank you
댓글 수: 0
채택된 답변
Kaustubha Govind
2011년 2월 2일
As long as the number of dimensions of your output do not change, and you are able to determine the largest size for each dimension, you should be able to do this using variable-size signals. The Level-2 MATLAB S-function demo described on this page actually does what you described.
댓글 수: 0
추가 답변 (1개)
Sebastian
2011년 2월 2일
I think this is not possible. The signal dimension of an S-Function port needs to be set during the initialization phase of the model. At that time Simulink usually doesn't know anything about the input signals. It might work in very special situations, i.e. when the input signal is driven by a Constant block. In other cases it will probably cause unexpected behavior.
I haven't tested this myself, but you can try to use the variable signal dimension feature in Simulink and so define the output port dimension to be variable sized.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 String에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!