Calling a MATLAB function from C#

后端 未结 3 579
南旧
南旧 2020-12-05 05:35

I developed a MATLAB function, and I\'m looking for a way to call that function from another C# application and pass some parameters to it and get the results in the C# prog

3条回答
  •  春和景丽
    2020-12-05 06:24

    There is a great example on this site on setting up everything. You can use MATLAB .NET deployment tool.

    You need to

    • Install MCR (Matlab Compiler Runtime).
    • Deploy your Matlab function to .NET Assembly using Matlab Deploy Tool. This will create a .dll file.
    • Add .dll reference inside your .NET project.
    • Add reference to MATLAB.NET.

    The advantage of this method is that the target machine does not require MATLAB to be installed, but on the downside the execution is quite expensive.

提交回复
热议问题