C # How to call the dynamic link library of MATLAB ?,
? ? Recently, C # is used as a program to display the ECG waveform in real time. We all know that when we collect ECG, we collect not only the ECG signal, but also some 50Hz power frequency interference and Baseline Drift. Therefore, we need to apply some filters to remove these interference signals, for filters, we must have designed them using MATLAB, so I will use the C # design interface. I will use MATLAB to write the filtering algorithm (relatively simple) and then generate a dynamic link library, C # Call the dynamic link library.
? ? The following is a simple example to learn how to call a dynamic link library. I haven't started my work yet.
1. First create a. m file in MATLAB
? ? ? ? ? ? ?
Save to D: \ Program Files \ MATLAB \ rw.a \ bin.
Enter deploytool in the Command window
In the pop-up dialog box, select the third,
Select the. m function we just saved. Because we use C # To call the dynamic link library, we must select. NET Assembly.
There will be a class,
The class name here is the class name of the object to be instantiated in C. Click package
This step is slow to generate a dynamic link library.
2. Step 2? Open VS2015, create a form application, right-click the reference in the right column, add the reference, import the two in the circle, drag a button in the toolbox, and enter the statement. See the figure below.
3. Complete. Run
Subsequent makeup
<