MATLAB: Is code folding not working as expected in MATLAB 7.8 (R2009a)

MATLAB

I am writing code in the MATLAB editor and code folding does not appear to be working even though I have enabled it in the MATLAB preferences directory.
I also receive an M-Lint error that pops up in a data-tip box which states:
M-Lint caused your previous MATLAB session to terminate unexpectedly. Please send this message and xxxx.m to MathWorks. See "About M-Lint and Unexpected MATLAB Termination" in the MATLAB documentation for details."

Best Answer

Code folding can fail when M-Lint detects an error with the code you are writing.
First, there may be an error in it that M-Lint is trying to warn you about and causing the code not to fold.
Second, if you get the erroneous datatip message, use the following directions to resolve it and the code folding should return to normal:
1. Remove any code from the file that you think M-Lint might believe to be an error.
2. Execute 'cd(prefdir)' at the MATLAB Command Prompt to navigate to the preferences directory.
3. In a text editor, open the MLintFailureFiles file.
4. Remove the entry for the MATLAB file in question that gives the erroneous data-tip. Save MLintFailureFiles.
5. Now reopen the MATLAB file. The M-Lint error should no longer occur and the code folding should return to normal.