Most likely, you've come across a bug in matlab. Unfortunately, the error message is generated by some underlying C++ code and has not been dealt with properly by matlab, so it's difficult to tell you what caused it.
If you can, post your script. Otherwise, execute your script one line at a time and find which line actually causes the error to occur and tell us what's on that line.
The error message is completely unhelpful and matlab shouldn't leak C++ error to the user, since there's nothing they can do about.