ewiger / mlab

Mlab is a high-level python to Matlab® bridge that lets Matlab look like a normal python library.
MIT License
74 stars 23 forks source link

'\0' not properly escaped when passing string #8

Open lrq3000 opened 8 years ago

lrq3000 commented 8 years ago

If a string contains '\0', MATLAB will think the string terminates at this point, and it will output a weird error (but only when using mlabraw, else you will get random errors in your softwares):

A MATLAB string constant is not terminated properly

The solution for me was to define my strings as raw before supplying them to mlab.

BTW, two other remarks:

  1. matlab.cd() doesn't work, you need to use os.chdir() before using your matlab commands to change the directory (by in fact changing Python's current dir).
  2. In the documentation, it's written mlab.log(0) when in fact it should be mlab.log(0.) (notice the dot), because we need to pass a float, else you get a warning about int32 type not recognized...

I'm on Windows 7 x64.