S function builder help multi inputs/outputs feedback

I am trying to use the s-function builder to create a multi input/output block that utilizes feedback. Are there any special things that I need to do in order to create a block that utilizes feedback and multi inputs/outputs, such as utilizing initial conditions or special handling of inputs and outputs in the c code?
I have been using this http://www.mathworks.com/help/simulink/sfg/s-function-builder-dialog-box.html as a starting place but it doesn't really explain how to use feedback and multi input/outputs in the c code?

Risposte (1)

One of the things you might need to do to avoid algebraic loops is turn off the "Inputs are needed in the output function (direct feedthrough)" checkbox on the Outputs pane, and make sure that you use internal DWork that is computed based on the inputs in the Update method, but not in the Outputs pane. In the Outputs pane, the internal DWork (which is a function of the Input(s)) is used to compute the output.

Prodotti

Richiesto:

il 7 Ott 2012

Community Treasure Hunt

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

Start Hunting!

Translated by