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

2 vues (au cours des 30 derniers jours)
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!

Réponses (0)

Produits


Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by