# Dynare steady state file cannot read exogenous variable values

**URL:** https://forum.dynare.org/t/dynare-steady-state-file-cannot-read-exogenous-variable-values/22886
**Category:** Steady state
**Created:** [11 August 2023 01:25 UTC](https://forum.dynare.org/t/dynare-steady-state-file-cannot-read-exogenous-variable-values/22886 "2023-08-11T01:25:49Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![missyushi](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/8edcca/32.png) [@missyushi](https://forum.dynare.org/u/missyushi)
#### Post date: [11 August 2023 01:25 UTC](https://forum.dynare.org/t/dynare-steady-state-file-cannot-read-exogenous-variable-values/22886/1 "2023-08-11T01:25:49Z")

</div>

Hello everyone,

I’m very new to Dynare and got stuck with reading exogenous variable values in the steady state file.

First of all, I need the steady state file because I need to call fsolve to solve two steady state equations numerically.

Second, the steady state file cannot read the exogenous variables that I declared in the initval block in the mod file. For example, in the mod file, I have specified that “eta = 1.006;”. But the error message I got is:

Unrecognized function or variable ‘gama’.

Error in mymodel6\_steadystate (line 32)  
r = (gama/betta + delta - 1) / (1-tauk);

I wonder is there any codes missing in the steady state file that reads in exogenous variables that I declared in the mod file. If so, what are the missing codes?

I have attached my codes. Any help would be greatly appreciated. Thank you so much for your time.  
[mymodel6\_steadystate.m](https://forum.dynare.org/uploads/short-url/lRIkxT7CdWPFmWBuRAFoRpEMGMj.m) (3 KB)

[clfcn.m](https://forum.dynare.org/uploads/short-url/n02DPH5fu3DcelUbGfICT8p7lHc.m) (334 Bytes)

[mymodel6.mod](https://forum.dynare.org/uploads/short-url/aRTDVbksznEdUBbUuCEuD5GB4li.mod) (3.0 KB)

---

<div class="post-metadata">

### Author: ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)
#### Post date: [16 August 2023 07:22 UTC](https://forum.dynare.org/t/dynare-steady-state-file-cannot-read-exogenous-variable-values/22886/2 "2023-08-16T07:22:02Z")

</div>

Sorry for the late reply. You need to add

```auto
for ii = 1:M_.exo_nbr
  eval([M_.exo_names{ii} ' = exo(' int2str(ii) ');']);
end

```

[mymodel6\_steadystate.m](https://forum.dynare.org/uploads/short-url/7fbo24PRABpJmTJPuewez5v7hPu.m) (3.1 KB)

---

<div class="post-metadata">

### Author: ![missyushi](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/8edcca/32.png) [@missyushi](https://forum.dynare.org/u/missyushi)
#### Post date: [16 August 2023 21:22 UTC](https://forum.dynare.org/t/dynare-steady-state-file-cannot-read-exogenous-variable-values/22886/3 "2023-08-16T21:22:37Z")

</div>

Thank you so much, Prof. Pfeifer. It solves my problem perfectly.
