Can we create a graphical interface in C # that will run MATLAB code in the back hand?

I developed the code in MATLAB and it works great. I worked in the GUI at MATLAB, but for me it was a headache. I think I can create a GUI simply and efficiently. Can we create a GUI in C # that will also run all the MATLAB code that I developed?

+2
source share
3 answers

Yes it is possible. For more information see:

MATLAB # (, WinForms), exe MATLAB (.m) - .NET, exe . : , , exe, ( ).

: -, MATLAB :

function y=SamplePlot(p, d, w, t)
numericValueP=str2num(p);
numericValueD=str2num(d);
numericValueW=str2num(w);
time=str2num(t);

%... do stuff ...
plot(...);

, str2num. . MATLAB

SamplePlot('1', '2', '3', '4')

SamplePlot.exe 1 2 3 4

.m: MATLAB :

deploytool

: SamplePlot.prj(). : . .m. : MCR ( MATLAB Compiler Runtime - , , MATLAB, ). :

mbuild -setup

, "build". exe. exe #, . :

private void button1_Click(object sender, EventArgs e)
{
      string p=TextBox1.Text;
      string d=TextBox2.Text;
      string w=TextBox3.Text;
      string t=TextBox4.Text;
      string params = String.Format("{0} {1} {2} {3}",p,d,w,t);
      System.Diagnostics.Process.Start("SamplePlot.exe", params);
}

, .

( , : exe ).

+4

#, .NET- MATLAB.

, , :

MATLAB / .NET-gui-, , , .NET-GUI MATLAB, MATLAB- . ., : http://www.mathworks.de/de/help/matlab/matlab_external/getting-started-with-net.html

, matlab- gui Matlab , , , .exe, MATLAB. , , , standalone.exe gui .

+1

This link is so useful and simple: Call the MATLAB function from C # Client

0
source

All Articles