Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can the output of a Simulink block be fed back as an input?

I have 2 embedded Matlab functions which I am using to create a Simulink model. Both functions use the output of the second function as their input. I am getting an error at the moment indicating that this is an invalid loop.

Does anyone know how to implement this type of behaviour?

Screenshot showing the model and the error

like image 730
lmirosevic Avatar asked Nov 29 '25 08:11

lmirosevic


1 Answers

You've created an algebraic loop, which means that to compute the inputs of the Embedded MATLAB block are directly dependent on the outputs of the block. This is not allowed when the loop is a "self-loop", i.e. there is only one block in the loop.

One way to fix this is to put Unit Delay block(s) somewhere on the signal feeding back into the Embedded MATLAB block. See the documentation on algebraic loops for more information.

like image 91
MikeT Avatar answered Nov 30 '25 22:11

MikeT



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!