# Text variables, matlab bridge

**URL:** <https://mworks.discourse.group/t/text-variables-matlab-bridge/412>\
**Category:** Support\
**Created:** [June 27, 2017, 7:33pm UTC](https://mworks.discourse.group/t/text-variables-matlab-bridge/412 "2017-06-27T19:33:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [June 27, 2017, 7:33pm UTC](https://mworks.discourse.group/t/text-variables-matlab-bridge/412/1 "2017-06-27T19:33:03Z")

</div>

Hi Chris,

We’re using MWorks 0.6 for this. When we use a text variable that has the value ‘’ (the empty string), its value doesn’t seem to be passed to the MATLAB bridge on the first trial when all variable values are passed to the bridge.

Not sure what the right behavior is - I could see an argument for ignoring variables whose value is the empty string, but it would be better for us if it were passed. Not a huge deal one way or the other - I’m now using ‘None’ as a blank value.

Mark

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [June 29, 2017, 2:45pm UTC](https://mworks.discourse.group/t/text-variables-matlab-bridge/412/2 "2017-06-29T14:45:23Z")

</div>

Hi Mark,

The attached example works for me. Every time I run the experiment, `values` has another empty string appended to it.

Remember that the MATLAB bridge only sends the values of variables that have _changed_ between sync on and sync off. Unless your string variable starts out non-empty and is then set to empty, it won’t be sent to your script.

Chris

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [June 29, 2017, 2:45pm UTC](https://mworks.discourse.group/t/text-variables-matlab-bridge/412/3 "2017-06-29T14:45:23Z")

</div>

Attachments:

- [empty\_string.m.txt](https://mworks.discourse.group/uploads/short-url/xGbeKg0rAmNes3oRyZmDmsSHQVW.txt) (403 Bytes)
- [empty\_string.xml](https://mworks.discourse.group/uploads/short-url/j5hfHkUS8qRIfRejxorgnTGY79A.xml) (1.23 KB)

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [July 19, 2022, 9:59pm UTC](https://mworks.discourse.group/t/text-variables-matlab-bridge/412/4 "2022-07-19T21:59:15Z")

</div>


