Dynamically Sized Inputs and Outputs

조회 수: 3 (최근 30일)
Daniel
Daniel 2012년 9월 7일
Hello,
I understand that when building an S-Function, whether from an M-File, C-MEX or S-Function Builder, with dynamically sized inputs and outputs Simulink always set the outputs width as the same size of the inputs.
Is there any way of bypassing this restriction?
I would like to create an S-Function in which both inputs and outputs are dynamically sized, although the size of the output must be defined from a fixed-size input.
Thank you.
  댓글 수: 2
Kaustubha Govind
Kaustubha Govind 2012년 9월 7일
Daniel: Do you mean the output is a variable-size signal whose size varies depending on the value of the input?
Daniel
Daniel 2012년 9월 10일
Yes, I would need an S-Function with two inputs (one being a vector and the other a single element). The second input will determine the size of the output and it is not the same size of the vector input.
Thank you

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

채택된 답변

Guy Rouleau
Guy Rouleau 2012년 9월 10일
Give a look at this post about creating variable size signals and s-function:
You will see that you have 2 options to determine the dimension of the output. If you type sfundemos in MATLAB, you will see ll example of s-function. Dig through that and you will find examples for both.

추가 답변 (0개)

카테고리

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