Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

mclTerminateApplication

Close MATLAB Runtime-internal application state

Synopsis

bool mclTerminateApplication(void)

Description

Call this function once at the end of your program to close MATLAB® Runtime-internal application state. Call only once per process. After you have called this function, you cannot call any further MATLAB Compiler SDK™-generated functions or any functions in any MATLAB library.

Caution

mclTerminateApplication must be called once only per process. Calling mclTerminateApplication more than once may cause your application to exhibit unpredictable or undesirable behavior.

Caution

mclTerminateApplication will close any visible or invisible figures before exiting. If you have visible figures that you would like to wait for, use mclWaitForFiguresToDie.

Examples

At the start of your program, call mclInitializeApplication to ensure your library was properly initialized:

mclInitializeApplication(NULL,0);
if (!libmatrixInitialize()){
    fprintf(stderr, 
            "An error occurred while initializing: \n %s ",
            mclGetLastErrorMessage());
    return -1;
}

At your program's exit point, call mclTerminateApplication to properly shut the application down:

mxDestroyArray(in1); in1=0;
mxDestroyArray(in2); in2 = 0;
mclTerminateApplication();
return 0;

Introduced in R2009a

Was this topic helpful?