(I want to exchange data between C# and Matlab. However, I cannot use the library when compiling. How to hide error?
My code here:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using MathWorks.MATLAB.Engine;
using MathWorks.MATLAB.Exceptions;
using MathWorks.MATLAB.Types;
using System;
namespace MathWorks.MATLAB.Engine.ConsoleExamples
{
public class Program
{
public static void Main(string[] args)
{
Console.Write("Starting MATLAB... ");
using (dynamic matlab = MATLABEngine.StartMATLAB())
{
Console.WriteLine("done.");
double[] A = matlab.linspace(-5.0, 5.0);
int[] sz = new int[] { 25, 4 };
double[,] B = matlab.reshape(A, sz);
}
// Call when you no longer need MATLAB Engine in your application.
MATLABEngine.TerminateEngineClient();
}
}
}
namespace UDP_virtual
{
internal static class Program
{
///
/// The main entry point for the application.
///
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}
But I don't compile. I assume I don't add lib for C# file.
0 comments:
Post a Comment
Thanks