В моем проекте я интегрирую приложение Matlab GUI с приложением C#.
Решение, о котором я подумал, состоит в том, чтобы создать автономное приложение из графического интерфейса Matlab и запустите его с помощью кнопки на C#:
Код: Выделить всё
Process exeProcess = Process.Start("Data_Capture_Direct_call.exe");
if(!exeProcess.HasExited)
{
exeProcess.WaitForExit();
}
exeProcess.Close();
In addition, the next few lines of code are not properly executed:
Код: Выделить всё
List Movement = new List();
List Repetition = new List();
List Duration = new List();
using (CsvFileReader reader = new CsvFileReader("capture.csv"))
{
CsvRow row = new CsvRow();
while (reader.ReadRow(row))
{
Movement.Add(row[0]);
Repetition.Add(row[1]);
Duration.Add(row[2]);
}
}
for (int i = 1; i < Movement.Count; i++)
{
dataGridView1.Rows.Add(i, Movement[i], Repetition[i], Duration[i]);
}
Please let me know where I am making a mistake or if there is a better way to do this!
Источник: https://stackoverflow.com/questions/273 ... om-c-sharp