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

13 views (last 30 days)
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.

Answers (0)

Categories

Find more on Simulink Functions in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!