Scan multi-output function with state variable a subset of outputs

Many thanks for the quick reply! The RNN seems like the relevant example. It seems that to get what I want, I need a function that has all output variables as inputs also, even if the function doesn’t act on some of them? I think I can live with that.