Hi, I have two questions.

- how to load steady state values into mod file?
- how to call a matlab function within the model block?

My purpose is to have a loop over parameters to see how IRF and other endogenous variables behave. Because of changing exogenously specified deep parameters, the utility function form and thus the marginal utility form in the Euler equation will change, as well as all steady state values.

The scenario is like this: first, I have defined a matlab function “solveSS” that with solve for steady state values of all endogenous variables according to exogenously given deep parameters (all deep parameters are exogenously specified); second, I have defined a matlab function call “unmu” which return utility and marginal utility when two variables and some exogenously specified parameters are input, so

```
function =unmu(c,h,paras)
if paras==1
u=....% equation that calculate utility level
muc=... % calculate marginal utility of c
muh=... % calculate marginal utility of h
else
u=....% equation that calculate utility level
muc=... % calculate marginal utility of c
muh=... % calculate marginal utility of h
end
```

Obviously, the way to calculate marginal utility depends on the parameters input.

Could anyone provide some hints about how to do such loops?

Ideally, I would think it is feasible to code like this:

```
//**************************************
// dynare mod file
//**************************************
//**************************************
// Declare variables and parameters
//**************************************
var ...
varexo ...
parameters ...
// provide parameter values
load parameters.mat
for npara=1:length(M_.params)
deep_parameter_name = M_.param_names(npara,:);
eval('M_.params(npara) = ' deep_parameter_name ' ;'])
end
// provide steady state values
**Please, how to load steady state values from my defined function 'solveSS'? **
....
//**************************************
model;
//**************************************
**please, how to call matlab function 'unmu' I defined that return marginal utility to me such that I can use it in my Euler equation?**
// Function 'unmu' will give me =unmu(c,h,parameters), where are utility level, marginal utility of c and h, respectively,
//but I only need muc and muh
// so could I write like this:
=unmu(c,h,parameters);
muc=beta*mucXXXXXXXXXXXXXXXXXXXXXXXXXXXX // No, wrong! Do not know how to do it, I need c(+1) and unmu(c(+1),h(+1), parameters) but this cannot be handle in unmu function
end;
```

Could someone provide samples that have similar scenarios?