Can I use an output of a Matlab function delayed by a memory block as an input for the same Matlab function in Simulink?

1 回表示 (過去 30 日間)
I wanted to define variables within a Matlab function in Simulink. To decide which values the variabels will have in the current simulation step the variable values from the previous simulation step are necessary and feedback delayed with a memory block.
If I do this I get an error message during compilation.
Without the feedback the model compiles but does not deliver the desired result.

採用された回答

Michael Melzer
Michael Melzer 2016 年 3 月 16 日
I found the answer. Inside the Matlab function I was using various IF ELSE Statements. Not all output variables were set in each case leading to inconsistencies in the outputs. Nevertheless the failure message was really unclear about this fact.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSimulink Functions についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by