Use VC and MATcom combined with development applications
1. What is MATCOM?
Matcom is a MATHTOOLS (Upenn) a transducer for a MATLAB M file based on C matrix function library Matrix. Mideva is a compilation environment (interface) for his integration.
Matcom is independent of Matlab, but it is necessary to be external C compiler, which requires specified when installing, otherwise it will not work. When installing, you need to specify that the location of the MATLAB is mainly for some system functions needed in the compilation file.
MathTools have been produced by MATLAB MATHWORKS, and the last version of MATCOM is 4.5, and the content of some Matcom is merged into the Visual Matlab of MathWorks.
2. How to use the MATCOM mathematics library in VC or C Builder?
1. Specify the path in Project / Add to Project / Select /Lib/v4500.lib or in the engineering settings.
2. The file header writes #include "matlib.h" and then you can use it.
3. How to remove the value of the element of the MATCOM matrix and give it to the C language variable?
example:
Double MyData [3] [3];
DMM (Amatrix);
Amatrix = rand (3);
For (INT i = 1; i <; = 3; i )
For (int J = 1; j <; = 3; J )
MyData [i-1] [j-1] = amatrix.r (i, j);
// or mydata [i-1] [j-1] = Amatrix.FastIndex (i, j);
You can also read the contents of the Amatrix.pr pointer to MYDATA with MEMCPY (), but the ranks need to be transposed.
4. How should MATCOM call in C ?
Here are some common arithmetic operators in C function tables,
For use of multiple output functions, i_o is used as a division meshgrid (color (0.0, 1.0), colon (0.0, 1.0), i_o, xi, yi);
[Xi, yi] = meshgrid (0: 1, 0: 1) in matlab; is equivalent.
5. How to convert C language variables to mm?
Still using MM's .r () function or .fastInDex () function, intermodate the left and right sides of the assignment statement can be interchanged in the example in this section 2). A.R (i, j) = (double) mydata [j] [i];
6. How to publish the VC / C Builder program for MATCOM 4.5 math libraries?
The MATCOM library is called in the VC / CB, so it is necessary to generate independent executions, so do not need the MATLAB system, but some necessary DLL files are still needed, these DLLs under the installation directory of Matcom, (in version 4.5) There are probably two files such as AGO4500.DLL, V4500V.DLL.
7. Install MATCOM when searching for Matlab path, what should I do?
The reason is that MATLAB 6.x's Windows version matLab.exe is not under matlab / bin, and in matlab / bin / win32, so when installing MATCOM, move BIN / WIN32 / MATLAB.EXE to BIN /, Move 1 After the layer catalog, after installing MATCOM, you can move back.
In fact, if Matlab has no effect on Matcom, you can choose not to install Matlab, still compile most files. You can use the addPath () to add a path or copy to the current directory when you need a file under Matlab / Toolbox. 8. Use Mideva when compiling some toolboxes and Simulink programs:
At present, MIDEVA / MATCOM is only a developing platform for pure. Mat file (it is a substitute for matlab), but Matlab, there are simulink / stateflow and other Toolbox / BlockSets that cannot be compiled for Mideva / Matcom because Mideva / Matcom is a JIT mechanism that cannot access other toolkits of Matlab, especially their DLL libraries. If other toolkies are plain text. Moiled! However, you can use the MATLAB compiler from MathWorks.