Why does Embedded MATLAB Function block not inherit the input port size in Simulink 6.0 (R14) and later?

1 visualizzazione (ultimi 30 giorni)
I use the Embedded MATLAB Function block in my model. I also have a direct feedback from the outputs of this block to its inputs. When I try to set the input port size to be inherited, I get the following error:
Embedded MATLAB Interface Error: 'fuel_migration/getWeight - While Iterator Subsystem/call_getWeight - EMF/ SFunction ' cannot use 'set default dimension function'

Risposta accettata

MathWorks Support Team
MathWorks Support Team il 27 Giu 2009
This is intended behavior in Simulilnk 6.0 (R14) and later, when the Embedded MATLAB Function block has a direct feedback connection.
In this case, the size of the input to the Embedded MATLAB Function block depends on the size of the output from the same Embedded MATLAB Function block. Therefore, the size must be specified somewhere to break the loop. To handle this case, Simulink defaults the signal dimension to a scalar. You can verify this in the Model Explorer in the "compiled size" field for the input signal.
This behavior is expected because graphical loops without size/type specifications can potentially cause errors in the propagation algorithm and should be avoided.

Più risposte (0)

Categorie

Scopri di più su Simulink Functions in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by