Reputation: 53
I have developed some matlab functions for voice authentication.
And now I want to use an application to provide input to those functions and execute those values in the matlab functions and get the results again to the application.
Is there any particular way to do this?
Upvotes: 4
Views: 2632
Reputation: 51
The following links can help you with your problem. The first one has used a matlab program in a c# program using COM objects and the second link has described 3 ways to communicate with matlab in a program.
http://www.codeproject.com/Articles/594636/Using-Matlab-from-a-Csharp-application
http://www.codeproject.com/Articles/5468/1-2-3-ways-of-integrating-MATLAB-with-the-NET
Upvotes: 0
Reputation: 655
This extract is taken from my blog post which demonstrates the procedures needed to compile a .NET dll from MATLAB CODE http://scriptbucket.wordpress.com/category/matlab/ this should be of some help to you.
using System;
using System.Windows.Forms;
using MathWorks.MATLAB.NET.Arrays;
using calculator;
namespace DemoCalculator
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
var calc= new demo();
MessageBox.Show(calc.calculator((MWCharArray)textBox1.Text)[1].ToString());
}
}
}
Upvotes: 0
Reputation: 11855
Mathworks has a product called the MATLAB Builder NE for doing just this.
It will build a DLL for either .NET or COM, wrapping the MATLAB code. You can then execute the code on any machine which has the MATLAB runtime (free) installed on it.
From what I've seen, this really just creates a DLL with the proper overloads for every function in your code, and helps you convert from .NET types into MATLAB arrays. In the end, it is still calling native MATLAB code and running it on the MATLAB runtime, so it is something that could be self-implemented as well (although it would take some probably significant effort).
Upvotes: 3