# If functions in Dynare

**URL:** https://forum.dynare.org/t/if-functions-in-dynare/1435
**Category:** Dynare help (legacy posts)
**Created:** [27 April 2010 08:26 UTC](https://forum.dynare.org/t/if-functions-in-dynare/1435 "2010-04-27T08:26:03Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![mp\_macro](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/c0e974/32.png) [@mp\_macro](https://forum.dynare.org/u/mp_macro)
#### Post date: [27 April 2010 08:26 UTC](https://forum.dynare.org/t/if-functions-in-dynare/1435/1 "2010-04-27T08:26:03Z")

</div>

Hello everybody,

I am relativly new with Dynare and so I am wondering wherther it is possible to use if functions (like in matlab) in Dynare.

e.g.:

if alpah\>=0.9;  
beta=0.2;  
else  
beta=0;  
end

I already checked the half forum but i could not find any subject relating to my question.  
Many thanks in advance for answering my question.

With best regards,  
mp\_macro

---

<div class="post-metadata">

### Author: ![AssiaEzzeroug](https://forum.dynare.org/letter_avatar_proxy/v4/letter/a/b19c9b/32.png) [@AssiaEzzeroug](https://forum.dynare.org/u/AssiaEzzeroug)
#### Post date: [29 April 2010 08:51 UTC](https://forum.dynare.org/t/if-functions-in-dynare/1435/2 "2010-04-29T08:51:58Z")

</div>

Hi,

yes it is possible to include into your mod-file the following directives:  
@#if  
@#else  
@#endif

see the Dynare macro language documentation

Best
