# Pass a matlab string to a MACRO\_VARIABLE

**URL:** <https://forum.dynare.org/t/pass-a-matlab-string-to-a-macro-variable/22320>\
**Category:** Macro-language\
**Created:** [21 April 2023 12:42 UTC](https://forum.dynare.org/t/pass-a-matlab-string-to-a-macro-variable/22320 "2023-04-21T12:42:40Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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:** [24 April 2023 17:14 UTC](https://forum.dynare.org/t/pass-a-matlab-string-to-a-macro-variable/22320/4 "2023-04-24T17:14:41Z")

</div>

That’s because the command line treats `xy` as a string. Use

```auto
xy =pwd

eval(['dynare mainfile -Dpath="' xy '"'])

```

to construct the proper string substitutions.

---

_[View the full topic](https://forum.dynare.org/t/pass-a-matlab-string-to-a-macro-variable/22320)._
