Boy, it took me a long time to find the bug in how I was doing it (which is very poor to begin with). This really solves the issue completely.
Note that Matthias's fix is essential though!
Toda Oren!
Very usefull - saved me a lot of time!
But there is a problem (Matlab 2008b, don't know about older releases) if a string contains the letter 'i' which is treated as a complex number and the program errors out at a later point. Therefore I added the following to line 141: "|| strcmp(tempString(i),'i')" what fixes the bug.