Is there a way to run a matlab script (without a function) in a C # Windows application? I want my Matlab script to run when I click a button in a C # form. I tried the Matlab compiler to build my script and got a dll as well using private MLApp.MLAppClass Matlab; But I'm not sure how to run it and the code in the button function.
Any help would be greatly appreciated. Thank.
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); }
}
source
share