Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
matlab functions in c# ?

Subject: matlab functions in c# ?

From: alexa mili

Date: 7 Sep, 2007 08:55:07

Message: 1 of 2

I write some functions in matlab r2007 and I wish to use
its in my c# (studio .net 2005) projects. How can I do it?
I see matlab builder hasn't any option for c#. Do I have
any chance to do this?

Thanks in advance,

alexa

Subject: matlab functions in c# ?

From: John reilly

Date: 7 Sep, 2007 11:42:20

Message: 2 of 2

hi alexa,

you have a chance. read the MATLAB "External Interfaces"
documentation.

you will see that MATLAB can be used as an automation (i.e.
COM) server. you can thus create a MATLAB COM object and
execute your m-file from your C# code, and get the
results. if you want help with this, as i always answer in
this forum, go to www.CodeProject.com and search for
MATLAB. CodeProject is your best friend.

*or*, you can use P/Invoke to wrap the C language "MATLAB
engine" interface.

*or*, you can use the MATLAB Compiler to generate a C DLL
and use P/Invoke to call into the unmanaged DLL from C#.

*or*, you can use the MATLAB .NET Builder to build yourself
a managed assembly to call directly from C#.

four options?? whaddaya want for nothing? rubber biscuits?

hth.

reilly.


"alexa mili" <alexa.4you.nospam@gmail.com> wrote in message
<fbr3la$dq9$1@fred.mathworks.com>...
> I write some functions in matlab r2007 and I wish to use
> its in my c# (studio .net 2005) projects. How can I do
it?
> I see matlab builder hasn't any option for c#. Do I have
> any chance to do this?
>
> Thanks in advance,
>
> alexa
>
>

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us