Skip to content

Matlab and VC++ Programming

28/04/2011

How to call C++ functions in Matlab? We may use mex to compile C++ codes. But when the C++ function is very complex, it may be difficult to use mex.

Here is a very simple way to call C++ functions in Matlab: call *.exe file in Matlab!!! Type

>>help system

in matlab to see how to call exe files. See here for some discussion on it.

In order to transmit data between Matlab and C++ function, we may use an intermediate *.txt file. That is to put data on the hard disk first. The *.exe file is also able to return a single data to matlab.

Advertisements
No comments yet

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s