Are there any ways to run a Matlab script (without function) in C# Windows Application? I would like my Matlab script to run when I click on a button in my C# form. I tried the Matlab Compiler to build my script and obtained the dll and also using private MLApp.MLAppClass Matlab; But I'm not too sure how to get it running and the code in the button function.
Any help would be much appreciated. Thank you.
using testNN;
public partial class Form1 : Form
{
private testNN.Class1 matlab;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
try
{
matlab = new testNN.Class1();
matlab.resourceforecast();
}
catch (Exception ex)
{ MessageBox.Show(ex.Message); }
}