Simulink and VC application interface a significant feature is that simulink simulation must rely on the MATLAB system, so far, MATLAB provides the engine way to the Simulink and VC application programming combined. To be through the engine way will simulink and VC combination of the first to master VC and MATLAB through the engine mode of mixed programming and Simulink command line simulation two aspects of the content.
MATLAB engine mode function library
MATLAB engine function library is MATLAB provides the engine way interface of a series of programs, it allows users to use their own C/s + + language or FORTRAN application of MATLAB to invoke, Matlab as a computing engine to use, let it run in the background, Complete the complex matrix computation, simplifies the front desk user program design the task.
When the user starts the MATLAB engine, quite has started another MATLAB process and runs in the background. The application through the MATLAB Engine function library provides the function to carry on the data exchange and the command transmission between MATLAB engine and the task. MATLAB Engine function Library provides a total of 13 C language engine functions, they are all in the header file engine. h, so that header file must be included when you use them. The following is a brief description of the six basic library functions in the engine library:
(1) Engopen
function: Start the MATLAB engine.
Syntax: engine* engopen (const char* startcmd);
Where the Startcmd is a string used to start the MATLAB process. In Windows, Startcmd must be null.
(2) Engclose
function: Exit MATLAB engine.
Syntax: int engclose (engine* EP);
Wherein, the EP is a engine type of pointer. Engclose issued to exit the MATLAB command, the success of the return of 0, otherwise return L.
(3) engevalstring
Function: Executes a MATLAB expression in string representation.
Syntax: int engevalstring (engine* EP, const char* string);
Where string is the command string, the string must be a valid MATLAB expression. Any commands that can be executed in the MATLAB command window can be executed in string form.