• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1985
  • Last Modified:

interfacing matlab and c++

    i have done some work in both matlab and c++.i wanted to know
about some good resources on the net about interfacing and using the two together and examples of application when the two are used together.
1 Solution
What do you want to do exactly? Call Matlab from C++? Or call C++ from Matlab?
Calling C++ from Matlab can be done by generating DLL from your C++ code and use the matlab inteface to generic DLL. Or, you can write C mex files, which is a sort of wrapper/interface for Matlab types. I find Mex files a bit more tedious to deal with. On the other hand, if you have older version of matlab, this is the only option. The other option is to use COM/DDE interface.
Calling Matlab from C++ can be done in two ways, using matlab engine or matlab compiler (extra $$).
As for resources and examples, Matlab's own document is a good starting point.

Yes, good summary by kjpus.

Here's a link for mex-files, because I think that is what you are asking about:

Ralf KlattPrincipal ConsultantCommented:

As far as I know is a "Vector" the basic data structure in MATLAB. It provides easy, fast, effective, and scalable data structures giving programming an algebraic view for data, even for complex data structures. Matlab allows you do develop fast technical solutions. However, MATLAB loops, and UIs are too slow :o. It is your responsibility to reformulate your code and data structures into matrices and vectors.

Here's a sample on how to use MATLAB in C++: http://www.codeproject.com/cpp/mtvector.asp

I hope this is what you're looking for ...
Best regards,

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now