# External MATLAB function in Dynare

**URL:** https://forum.dynare.org/t/external-matlab-function-in-dynare/2502
**Category:** Stochastic simulations
**Created:** [2 May 2012 08:52 UTC](https://forum.dynare.org/t/external-matlab-function-in-dynare/2502 "2012-05-02T08:52:27Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![mary](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/e99b99/32.png) [@mary](https://forum.dynare.org/u/mary)
#### Post date: [2 May 2012 08:52 UTC](https://forum.dynare.org/t/external-matlab-function-in-dynare/2502/1 "2012-05-02T08:52:27Z")

</div>

Hello everyone!  
I am trying to incorporate a matlab function in Dynare, but it doesn’t seem to like it. I have a linearized model, in which some coefficients depend on steady state values. Therefore, I solved for the steady state by hand and I wrote a matlab function (called ssvalues) which, given values for the model parameters, gives the steady state values as outputs. I tried to incorporate this function in my .mod file after the the “parameters” block, when I specify values of parameters. In particular, I coded:  
beta = 0.998;  
[y\_ss, c\_ss, otherssvalues\_ss] = ssvalues(beta);

When I try to run the .mod file I get the following error message:

STEADY: numerical initial values incompatible with the following equations  
Columns 1 through 14

```
 1 2 3 4 5 6 7 8 9 10 11 12 13 14

```

Columns 15 through 28

```
15 16 17 18 19 20 21 22 23 25 27 28 29 31

```

Columns 29 through 31

```
32 33 34

```

??? Error using ==\> dynare\_solve at 94  
exiting …

Error in ==\> steady\_ at 120  
[oo\_.steady\_state,check] = dynare\_solve([M\_.fname ‘\_static’],…

Error in ==\> steady at 54  
steady\_;

Error in ==\> basesimple at 386  
steady;

Error in ==\> dynare at 120  
evalin(‘base’,fname) ;

Apparently, Dynare does not use the outputs of my function as parameters of the model. 😮 Can anyone tell me why this happens and how can I do tho fix this problem?  
Thank you very much!  
Best,

Mary

---

_[View the full topic](https://forum.dynare.org/t/external-matlab-function-in-dynare/2502)._
