I encountered the same error using a recursive function. I managed to fix it doing the following things, though I 'm not sure which one did it.
1. went to C:\Users\"user"\AppData\Roaming\MathWorks\MATLAB\R20.. and deleted every xml, settings file etc after I backed it up on another folder.
2. deleted the m file with the recursive function as I saw it was stored in those files to reopen next time
3. deleted log file(in order to check the new error log)
4. run matlab.bat from C:\Program Files\MATLAB\R20..\bin
5. re copied the files back from step 1
After that it worked (I think deleting the m file did the trick)