Solving a Simulink Function with Algebraic Loop

6 visualizaciones (últimos 30 días)
Taha Batur Topsakal
Taha Batur Topsakal el 27 de Mayo de 2022
Respondida: Sam Chak el 27 de Mayo de 2022
I have a MATLAB function that does some calculations and gives 3 outputs which will be used again as an input to this function. This function is like
function [out1,out2,out3]=LoopFunction(out1,out2,out3,param1,param2,param3,param4,input,param5)
% does something...
input variable will be used as a step function and param inputs are just constants.
Normally in MATLAB i can do something like this and do what i want just fine
param1 = 1 ; param2 = 1; param3 = 1; param4 = 1 ; param5 = 1;
out1_init = 1;
out2_init = 1;
out3_init = 1;
for i=1:1000
if i == 1
[out1,out2,out3] = LoopFunction(out1_init,out2_init,out3_init,param1,param2,param3,param4,1,param5)
else
[out1,out2,out3] = LoopFunction(out1,out2,out3,param1,param2,param3,param4,1,param5)
end
end
But i don't know how to do this on Simulink. Is there any way to implement this? So far i have tried something as belows but i cannot find a way to initilize out1 , out2 and out3.
Thank you

Respuestas (1)

Sam Chak
Sam Chak el 27 de Mayo de 2022
This article explains about the Algebraic Loop Concepts:
and this one suggests some solutions that you can take:

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by