I need to create a for, if or while loop on simulink for repetitive calculation until meeting a criterion

2 次查看(过去 30 天)
Hello everybody!
I need to create a loop (i guess with using for and if statements) especially on Simulink.
I have a complex setup, therefore I'll ask my question on a much simpler example.
Let's say I have a func A=x^2 ,and a desired value of it as A_reference=100
by starting from x=0, i need to find the error rate between A_reference and A_calculated and if the error rate is not smaller than a certain value,
i need to update the x and feed it to the system again, then calculate the error rate until it meets the criterion.
How can I do it on Simulink? Can you guys show me an example of it?
There are documentation of while and for iterators but I couldn't find any helpful examples..
Thanks in advance!

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 String 的更多信息

产品


版本

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by