Main Content

matlab.crashhandling.crashReportFolder

Locate crash report folder

Since R2025a

    Description

    p = matlab.crashhandling.crashReportFolder returns a path to the root folder for MATLAB® crash reports for the current release.

    Use this function to locate crash reports when MATLAB does not display the Crash Reporter. For example, the Crash Reporter is unavailable when you start MATLAB with the -nodisplay option. The most recent report is most likely to be related to your crash. Depending on how MATLAB crashed, other crash files might be located in different folders. For more information, see When MATLAB Terminates Unexpectedly.

    Examples

    collapse all

    Suppose that MATLAB crashes on a Windows® platform without displaying the Crash Reporter.

    Restart MATLAB. Then enter the following commands in the Command Window to navigate to the crash report folder and display its path. Your crash report folder path will differ from the one displayed in this example.

    p = matlab.crashhandling.crashReportFolder; 
    cd(fullfile(p,"reports"));
    pwd
    ans =
    
        'C:\Users\username\AppData\Local\MathWorks\C026Y8Fa_TFe6KYxCK0sIjoHY44heZ2GPXhPtpoGdxA\crash_reports\reports'

    Suppose that MATLAB crashes on a macOS platform without displaying the Crash Reporter.

    Restart MATLAB. Then enter the following commands in the Command Window to navigate to the crash report folder and display its path. Your crash report folder path will differ from the one displayed in this example.

    p = matlab.crashhandling.crashReportFolder; 
    cd(fullfile(p,"completed"));
    pwd
    ans =
    
        '/Users/username/Library/Application Support/MathWorks/cAd46HyZkLpootBgZnXvdNdajuBOHbIqJl0ajNmT0pg/crash_reports/completed'

    Suppose that MATLAB crashes on a Linux® platform without displaying the Crash Reporter.

    Restart MATLAB. Then enter the following commands in the Command Window to navigate to the crash report folder and display its path. Your crash report folder path will differ from the one displayed in this example.

    cd(fullfile(matlab.crashhandling.crashReportFolder,"completed"))
    pwd
    ans =
    
        '/home/username/.MathWorks/2BpCG91Z6-TV_EhnQMA05mxEV2YCmn8yXFMyE_iXvgk/crash_reports/completed'

    Output Arguments

    collapse all

    Path to the root folder for MATLAB crash reports for the current release, returned as a character vector. When you install and run MATLAB for the first time, MATLAB generates a folder that is unique to your installation.

    Version History

    Introduced in R2025a