Solving a Simulink Function with Algebraic Loop

8 Ansichten (letzte 30 Tage)
Taha Batur Topsakal
Taha Batur Topsakal am 27 Mai 2022
Beantwortet: Sam Chak am 27 Mai 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

Antworten (1)

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

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange

Produkte


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by