You basically need a memory. There are possibly multiple ways of doing this.
- Delay is a memory. You can set its initial conditions for start up values. You can either put the Delay inside an enabled sub-system to write new values or you can use a mux to write new value or previous value from output of delay.
- You can use a MATLAB Function block and declare a persistent variable in it. You can initialize this inside a check for "is empty(persistent_var_name)" and then read or write into it.
One more way is how the original question implements it using "Data Store".