[matlab] The matlab algorithm is packaged into a toolkit and provided to the program call

illustrate:

1. Non-process communication protocol, no need to install a full version of the matlab development environment on the computer.

2. This project takes C# as an example, the calling language is not limited, and the operation process is basically the same.

1. Preparation

1. Install MATLABWebAppServerSetup integrated development environment

2. Install Visual stdio 2017 integrated development environment

3. Download the built C# project BuildAction

 https://download.csdn.net/download/oqqHun123/87886504

2. Package the algorithm written by matlab

1. Find the lib packaging tool in the toolbar

 2. Select the platform for calling the algorithm, select the function file written by matlab, and finally click package

 3. Find the directory folder that was just packaged, and select the .dll file that was packaged and generated

 At this point, the matlab algorithm packaging work is completed.

3. Encapsulate the matlab algorithm into a toolkit and provide it to the program call

1. Use vs to open the BuildAction project

 When a pop-up window appears, click OK

The project integrates various dependent environments such as C, C++, and C# by default, and has strong scalability

2. Add dependent references

3. Add a button to realize the calling function of matlab function

4. Since the current project C++ uses 32-bit services, while matlab uses 64-bit services, the two cannot provide services at the same time .

If you need to provide matlab services, please configure the build target platform in the buildAction attribute as follows

 5. After saving the configuration, click Start to use the service provided by matlab, but the call of matlab runtime is slow, depending on the calculation time of the algorithm, please wait patiently after calling

Guess you like

Origin blog.csdn.net/oqqHun123/article/details/131128322