What can I do if I get a segmentation violation when running M-files?
Occasionally segmentation violations occur while you are running M-files. MATLAB performs all its memory allocations and de-allocations internally, and a segmentation violation that occurs when you are running M-files can usually be traced back to a built-in function.
If the error is caused by one of our functions, we may already know about it, and we may have a solution available. To see if this is the case, try looking up the error in our Solution Search Engine on our Web site (
The MathWorks - Support). Tip: Try searching under "segmentation violation" and the name of the function.
If you can't find the information you need in our Solution Search, try reproducing the error on your machine and on other machines running the same version of MATLAB. If you can reproduce the error on your machine but not on others, try reinstalling MATLAB, as some of the files on your machine may be corrupt. If you can reproduce the problem in all cases, please let us know (
The MathWorks - Support) so we can try to address it. Please include all the information re-quested in the error message, so that we can easily reproduce the problem and find a quicker fix to the problem.