Skip to Main Content Skip to Search
Login
File Exchange
MATLAB Newsgroup
Link Exchange
  Blogs  
 Contest 
MathWorks.com

Thread Subject: interface .NET/ VC++ and Matlab

Subject: interface .NET/ VC++ and Matlab

From: Vihang Patil

Date: 16 Jan, 2008 11:14:02

Message: 1 of 5

Hello
I would like to interface .Net or VC++ with Matlab.
In brief, there is some code which is developed in .NET or
VC++ and now I want to execute that code in Matlab.
I have absolutely no programming knowledge and knowhow
whatsoever about .NET and VC++ and one of my friend will
be developing the code in either .NET or VC++ which I am
interested to execute in Matlab
Now, my questions are;
1. How do I do this?
2. Should I use the code from .NET/VC++ and modify somehow
to make it work in Matlab? or should I ask him to give me
a dll? or something else which can be called in Matlab?

Please help. If some one can provide any small example
would really be useful

Regards
Vihang


 

Subject: Re: interface .NET/ VC++ and Matlab

From: Vihang Patil

Date: 18 Jan, 2008 09:25:04

Message: 2 of 5

any help?

Subject: Re: interface .NET/ VC++ and Matlab

From: Kevin

Date: 19 Jan, 2008 00:03:02

Message: 3 of 5

On Jan 18, 10:25=A0am, "Vihang Patil" <vihang_pa...@yahoo.com> wrote:
> any help?

I'm also intressested in an answer, I have a simular question but also
still no answer :-s I hope someone has an answer??!!

Subject: Re: interface .NET/ VC++ and Matlab

From: John reilly

Date: 22 Jan, 2008 13:43:02

Message: 4 of 5

The answer depends upon the code you want to call from
MATLAB.

If unmanaged (i.e. straight C/C++), the (probably) easiest
thing to do is to wrap it in an old-school Windows DLL.
You can use MATLAB loadlibrary/calllib to access it. don't
forget to export your DLL's entry points as extern "C". If
your interface is simple, this will be the easiest. If
your interface is more complicated, you may want to write a
C mex wrapper that you call from MATLAB, and that wrapper
links to your library, translating the MX-Array arguments
to/from C.

If your code is managed (i.e. runs on the CLR), much more
difficult. In that case, you'll need to create a C mex
wrapper that hosts the CLR for you. CodeProject.com will
help you out there.

hth.

reilly.



"Vihang Patil" <vihang_patil@yahoo.com> wrote in message
<fmkotq$4tv$1@fred.mathworks.com>...
> Hello
> I would like to interface .Net or VC++ with Matlab.
> In brief, there is some code which is developed in .NET
or
> VC++ and now I want to execute that code in Matlab.
> I have absolutely no programming knowledge and knowhow
> whatsoever about .NET and VC++ and one of my friend will
> be developing the code in either .NET or VC++ which I am
> interested to execute in Matlab
> Now, my questions are;
> 1. How do I do this?
> 2. Should I use the code from .NET/VC++ and modify
somehow
> to make it work in Matlab? or should I ask him to give me
> a dll? or something else which can be called in Matlab?
>
> Please help. If some one can provide any small example
> would really be useful
>
> Regards
> Vihang
>
>
>

Subject: Re: interface .NET/ VC++ and Matlab

From: Nishtha Nagrath

Date: 07 Mar, 2008 11:19:01

Message: 5 of 5

"John Reilly" <jrhokie1.nospam@yahoo.com> wrote in message
<fn4rt6$2cq$1@fred.mathworks.com>...
> The answer depends upon the code you want to call from
> MATLAB.
>
> If unmanaged (i.e. straight C/C++), the (probably) easiest
> thing to do is to wrap it in an old-school Windows DLL.
> You can use MATLAB loadlibrary/calllib to access it. don't
> forget to export your DLL's entry points as extern "C". If
> your interface is simple, this will be the easiest. If
> your interface is more complicated, you may want to write a
> C mex wrapper that you call from MATLAB, and that wrapper
> links to your library, translating the MX-Array arguments
> to/from C.
>
> If your code is managed (i.e. runs on the CLR), much more
> difficult. In that case, you'll need to create a C mex
> wrapper that hosts the CLR for you. CodeProject.com will
> help you out there.
>
> hth.
>
> reilly.
>
>
>
> "Vihang Patil" <vihang_patil@yahoo.com> wrote in message
> <fmkotq$4tv$1@fred.mathworks.com>...
> > Hello
> > I would like to interface .Net or VC++ with Matlab.
> > In brief, there is some code which is developed in .NET
> or
> > VC++ and now I want to execute that code in Matlab.
> > I have absolutely no programming knowledge and knowhow
> > whatsoever about .NET and VC++ and one of my friend will
> > be developing the code in either .NET or VC++ which I am
> > interested to execute in Matlab
> > Now, my questions are;
> > 1. How do I do this?
> > 2. Should I use the code from .NET/VC++ and modify
> somehow
> > to make it work in Matlab? or should I ask him to give me
> > a dll? or something else which can be called in Matlab?
> >
> > Please help. If some one can provide any small example
> > would really be useful
> >
> > Regards
> > Vihang
> >
> >
> >
>


Hi all
I am new to MATLAB.I want to write c++ wrappers in
MATLAB.For this i have made a project in VC++ and want to
use this.
What i want to know is that is it necesaary to write a
static library in VC++ to call it from MATLAB or any MFC
application can be used to do the same.
Kindly help.

Thanks in advance

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

Tag Activity for This Thread
Tag Applied By Date/Time
vc Vihang Patil 16 Jan, 2008 06:14:57
dll Vihang Patil 16 Jan, 2008 06:14:57
interface Vihang Patil 16 Jan, 2008 06:14:57
net Vihang Patil 16 Jan, 2008 06:14:57
rssFeed for this Thread

envelope graphic E-mail this page to a colleague

Public Submission Policy
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.
Related Topics