Solving a Simulink Function with Algebraic Loop

조회 수: 6 (최근 30일)
Taha Batur Topsakal
Taha Batur Topsakal 2022년 5월 27일
답변: Sam Chak 2022년 5월 27일
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

답변 (1개)

Sam Chak
Sam Chak 2022년 5월 27일
This article explains about the Algebraic Loop Concepts:
and this one suggests some solutions that you can take:

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by