MATLAB Runtime Startup Options

Retrieve MATLAB Runtime Startup Options

Use these functions to return data about the MATLAB® Runtime state when working with shared libraries.

Function and SignatureWhen to UseReturn Value
bool mclIsMCRInitialized()Use mclIsMCRInitialized() to determine whether or not the MATLAB Runtime has been properly initialized.Boolean (true or false). Returns true if MATLAB Runtime is already initialized, else returns false.
bool mclIsJVMEnabled()Use mclIsJVMEnabled() to determine if the MATLAB Runtime was launched with an instance of a Java® Virtual Machine (JVM™).Boolean (true or false). Returns true if MATLAB Runtime is launched with a JVM instance, else returns false.
const char* mclGetLogFileName()Use mclGetLogFileName() to retrieve the name of the log file used by the MATLAB Runtime.Character string representing log file name used by the MATLAB Runtime.
bool mclIsNoDisplaySet()Use mclIsNoDisplaySet() to determine if -nodisplay option is enabled.Boolean (true or false). Returns true if -nodisplay is enabled, else returns false.

Note

false is always returned on Windows® systems since the -nodisplay option is not supported on Windows systems.

When running on Mac, if -nodisplay is used as one of the options included in mclInitializeApplication, then the call to mclInitializeApplication must occur before calling mclRunMain.

Note

All of these attributes have properties of write-once, read-only.

Retrieve Information About MATLAB Runtime Startup Options

 const char* options[4];     
    options[0] = "-logfile";    
    options[1] = "logfile.txt";
    options[2] = "-nojvm";
    options[3] = "-nodisplay"; 
    if( !mclInitializeApplication(options,4) )
    {
        fprintf(stderr, 
                "Could not initialize the application.\n");
        return -1;
    }
    printf("MCR initialized : %d\n", mclIsMCRInitialized());
    printf("JVM initialized : %d\n", mclIsJVMEnabled());
    printf("Logfile name : %s\n", mclGetLogFileName());
    printf("nodisplay set : %d\n", mclIsNoDisplaySet());
    fflush(stdout);
Was this topic helpful?