Simple feedback in Simulink for the MATLAB function block (updating inputs)?

1 次查看(过去 30 天)
Hi,
I'm writing a program in MATLAB that involves a simple form of feedback and would like to convert it to Simulink for practical purposes. It isn't a control system (so it hopefully wouldn't require the corresponding package), but it basically takes initial values for the inputs as variables and updates these variables as the program runs.
The attached diagram is a (very simple) example of the kind of techniques I need to use:
-x(0) is input by the user.
-When x(0) goes through the algorithm block (implemented as a MATLAB function block), both the timeslot's current output y(t) and the next timeslot's input value x(t+1) are calculated.
-x(t) is replaced with x(t+1) for the next timeslot, and the cycle continues.
How can I implement this? Furthermore, how can I specify the number of timeslots/cycles that the simulation should go through?
Any help would be much appreciated. Let me know if there's something I'm not being clear about.

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Schedule Model Components 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by