Documentation

mclInitializeApplication

Set up application state shared by all MATLAB Runtime instances created in current process

Synopsis

bool 
  mclInitializeApplication(const char **options, int count)

Description

Set up the application state shared by all MATLAB® Runtime instances created in current process. Call only once per process. The function takes an array of strings (possibly of zero length) and a count containing the size of the string array. The string array may contain the following MATLAB command line switches, which have the same meaning as they do when used in MATLAB:

  • -appendlogfile

  • -Automation

  • -beginfile

  • -debug

  • -defer

  • -display

  • -Embedding

  • -endfile

  • -fork

  • -java

  • -jdb

  • -logfile

  • -minimize

  • -MLAutomation

  • -nodisplay

  • -noFigureWindows

  • -nojvm

  • -noshelldde

  • -nosplash

  • -r

  • -Regserver

  • -shelldde

  • -singleCompThread

  • -Unregserver

  • -useJavaFigures

  • -mwvisual

  • -xrm

Caution

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

Caution

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.

Examples

To start all MATLAB Runtime in a given process with the -nodisplay option, for example, use the following code:

const char *args[] = { "-nodisplay" }; 
if (! mclInitializeApplication(args, 1))
{
   fprintf(stderr, 
           "An error occurred while initializing: \n %s ",
           mclGetLastErrorMessage());
   return -1;  
}

Introduced in R2009a