# Changing macro\_expression outside of the .mod file

**URL:** <https://forum.dynare.org/t/changing-macro-expression-outside-of-the-mod-file/18374>\
**Category:** Macro-language\
**Created:** [22 June 2021 09:15 UTC](https://forum.dynare.org/t/changing-macro-expression-outside-of-the-mod-file/18374 "2021-06-22T09:15:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mat1339](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/f9ae1b/32.png) [@mat1339](https://forum.dynare.org/u/mat1339)\
**Post date:** [22 June 2021 09:15 UTC](https://forum.dynare.org/t/changing-macro-expression-outside-of-the-mod-file/18374/1 "2021-06-22T09:15:13Z")

</div>

Dear all,

is it possible to change the expression of a MACRO\_VARIABLE outside of the .mod file?

For example, I would like to be able to specify whether “deterministic\_simul” is true or false in another Matlab file. Is that feasible?

@#define deterministic\_simul = false

@#if deterministic\_simul == true  
@#include “ScenariosDeterministic.m”  
@#else  
@#include “ScenariosStochastic.m”  
@#endif

Thanks!

---

<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:** [22 June 2021 09:53 UTC](https://forum.dynare.org/t/changing-macro-expression-outside-of-the-mod-file/18374/2 "2021-06-22T09:53:31Z")

</div>

Yes, with the `-D` switch at the command line. See the manual and [DSGE\_mod/run\_model\_IRF\_generation.m at master · JohannesPfeifer/DSGE\_mod · GitHub](https://github.com/JohannesPfeifer/DSGE_mod/blob/master/Born_Pfeifer_2020/run_model_IRF_generation.m) for an example.

---

<div class="post-metadata">

**Author:** ![mat1339](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/f9ae1b/32.png) [@mat1339](https://forum.dynare.org/u/mat1339)\
**Post date:** [22 June 2021 10:19 UTC](https://forum.dynare.org/t/changing-macro-expression-outside-of-the-mod-file/18374/3 "2021-06-22T10:19:00Z")

</div>

Perfect, thank you very much!
