Wednesday 15 July 2015

Two way communication between MATLAB and C# -



Two way communication between MATLAB and C# -

i have 3rd party matlab toolbox, performs calculation on set of data. designing windows form based application in c# integrate matlab toolbox. next primary requirements-

the windows form i.e c# application can invoked matlab if uses performs operation in windows form, form should able phone call method , pass parameters matlab toolbox. form should able info returned matlab well. also if user modify data/parameters in matlab should reflected in windows form.

from google search, got plenty of results phone call c# application matlab using com approach. looking 2 way communication between matlab , c#. please note communication should fastest possible.

i've tried related this, , can see solution arrived @ in this question. ultimately, you're gonna have utilize com if plan have meaningful interaction between 2 programs. i've looked uiautomation unfortunately matlab exposes nil can use.

to address questions individually:

should pretty simple using shell escape phone call c# app. app should back upwards command line arguments, or utilize kind of interop pass running instance of app (see 3). this doable. see linked question how interop running instance of matlab c#. this going hard part. going have write own com server in app , create com client in matlab interop app. won't automatic though since user have type kind of command initiate interop matlab. way can think of making automatic have app poll matlab's workspace using com in fixed time intervals, , figure out if has changed (neither simple nor efficient).

the conclusion? way much work bothered , you're much improve off writing matlab gui. if need functionality .net framework can utilize matlab's .net interface.

c# matlab

No comments:

Post a Comment