"mex -setup" when i run this command in matlab command window i am getting error message like "Unable to complete successfully" How to solve this?

1 view (last 30 days)
I am trying to execute m script through C#.net code and want to create .txt file when i run my c# code i am getting error message(please see the attached file). As per error message window instruction i am trying to run mex -setup commond in matlab but it showing like "Unable to complete successfully". please help me resolve this problem as soon as possible. Here is my code...
//C# Code namespace WindowsFormsApplication1 { public partial class Form1 : Form {
private MLApp.MLApp Matlab;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
string strMScriptPath = textBox1.Text.ToString();
Matlab = new MLApp.MLApp();
Matlab.Execute(strMScriptPath);
}
}
}
//m-script Name = {'M4';'M5';'M6';'M8';'M10'}; Pitch = [0.7;0.8;1;1.25;1.5]; Shape = {'Pan';'Round';'Button';'Pan';'Round'}; Price = [10.0;13.59;10.50;12.00;16.69]; Stock = [376;502;465;1091;562]; T = table(Pitch,Shape,Price,Stock,Name); writetable(T,'TableData.txt');
  6 Comments
Walter Roberson
Walter Roberson on 15 Dec 2015
You are using before r2014a so try
delete(fullfile(prefdir,'mexopts.bat'))
And then run
mex -v setup
If that gives you the same message then you might have a corrupted install of a compiler or your mex.m might be corrupt or you might have something on your matlab path that is interfering with the operation of mex.
From r2014a mex is handled a different way which I will link to fof future reference in case other people look at this in future.

Sign in to comment.

Answers (0)

Categories

Find more on MATLAB Compiler SDK in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!