I'm using a matlab function block in a feedback loop and have an algebraic loop. Simulink can solve it but I need to run it on target hardware so I have to get rid of the algebraic loop. Based on this link
I think that I need to utilize non direct feedthrough on the matlab function block. I created a simplified example based on the link but I always get the following error when I disable direct feedthrough:
Output variables of MATLAB Function 'alg_loop_test/MATLAB Function2' cannot depend on input data 'cnt', because the 'Allow Direct Feedthrough' property has been disabled for this block.
I can't upload my model but I've attached a screenshot. It seems to me that you cannot use the inputs to the function in the calculation of the output of the function if you disable direct feed through. But how can you calculate the output if not by using the input? Clearly I'm missing the concept here and could use an example of a matlab function block that uses non direct feedthrough to explain.
Best Answer