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 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 String 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!