spaceconcordia / rocketry-performance

2 stars 1 forks source link

S-Function - Can't assign Matlab functions defined on path (Level 1 vs Level 2) #6

Closed SpaceShawn closed 9 years ago

SpaceShawn commented 9 years ago
  1. How to create level-2 S-Functions
  2. How to change input/output parameters
  3. What are Demux and Terminator

1 - How to create level-2 S-Functions

When Matlab Functions are copied from a model into a library, they are conveniently converted to Level 2 S-Functions. However, assigning the S-Functions to the Matlab functions defined on the path does not work.

See sfunction_test.slx for an example

The specified MATLAB File 'thrust_hack' in 'thrust_curve_test/THRUST/ SFunction ' is not a valid Level 1 S-Function. The number of input and/or output arguments is not valid. A likely cause for this error is that the name of a level-2 MATLAB S-function has been specified in this block (which supports only level-1 MATLAB S-functions). Use the 'Level-2 MATLAB S-Function' block from the Simulink library

2 - How to change input/output parameters


3 - What are Demux and Terminator?

SpaceShawn commented 9 years ago

Interpreted Matlab Functions were found to be suitable with some additional blocks to mux and demux the inputs and outputs, respectively