Matlab function to determine varexo_det values

Hello. I am trying to simulate a simple deterministic model in Dynare, and I have a Matlab function that takes an integer for a current period and returns a value of an exogenous variable for this period. Is it possible for Dynare to call this function to determine the value of the exogenous variable in the model?
Thank you

First, note that exogenous variables in deterministic models should be declared with “varexo”, not “varexo_det” (which is only used for stochastic models).

It is possible to do what you want by filling the “oo_.exo_simul” vector with the values of the exogenous at every period. This structure has as many colums as there are exogenous, and max_lag+T+max_lead rows corresponding to periods (where T is the number of simulation periods, and the extra rows are for initial and terminal conditions).