When I send an array from C# to MATLAB (as shown in the following code snippet), I get a segmentation violation.
if (userpath == null) userpath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\matlab";Type mlt = Type.GetTypeFromProgID("Matlab.Desktop.Application");//.Desktop//Application.SingleMLApp.MLApp ml = (MLApp.MLApp)Activator.CreateInstance(mlt);ml.Execute("userpath = " + userpath);ml.Execute("cd " + userpath);ml.PutWorkspaceData(name, "base", data);ml.Execute(string.Format("imagesc({0});colormap(gray);axis image", name));
Best Answer