Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MATLAB functions in C++ [closed]

Does anyone know a resource where we can obtain FREE C++ libraries for MATLAB functions? For example, linear algebra problems can be solved using LAPACK and BLAS.

Also, MATLAB in a .NET project is out of the question - I'm talking about direct C++ implementations of popular MATLAB functions (I don't know which functions I need in C++ yet but the functions used are not going to be esoteric).

Any suggestions about such resources?

like image 676
Jacob Avatar asked Aug 25 '09 18:08

Jacob


People also ask

Does MATLAB run on C?

Access MATLAB Algorithms from Your C and C++ ApplicationsYou can use MATLAB algorithms in your C and C++ applications. The MATLAB Engine API for C and C++ enables your applications to use and modify variables in the MATLAB workspace, call MATLAB functions, and evaluate MATLAB commands.

Which programming language is close to MATLAB?

Python: Python [4] is another high-level language and at first sight very similar to MATLAB: it is interpreted, has an interactive prompt, allows dynamic typing and provides automatic memory management (and comes with in-built complex numbers).

What is C function in MATLAB?

Directly call C library functions from MATLAB® R2021b or earlier, using calllib function. A shared library is a collection of functions dynamically loaded by an application at run time. The MATLAB interface supports libraries containing functions defined in C header files.

How do I force close MATLAB?

Ways to Quit or ExitClick the close button on the MATLAB® desktop. Click. on the left side of the desktop title bar and select Close. Type quit or exit at the command prompt.


2 Answers

I've never heard of a comprehensive port of matlab functionality to C++. That being said, almost everything matlab does exists within a C/C++ library somewhere, some off the top of my head:

  • LAPACK, BLAS, you already mentioned these, and there are a few good implementations, the most notable (free) one being ATLAS.
  • FFT is implemented in matlab via the fftw library
  • There are loads of fast open-source image libraries out there, ie. interpolation, filtering.
  • There are really good OOP matrix libraries out there, boost has a nice one.

After that, well figure out what you need and there is a good chance someone has implemented it in C/C++.

like image 185
DeusAduro Avatar answered Oct 21 '22 18:10

DeusAduro


I also like

  • Armadillo (templated C++ library)
  • Eigen (another templated C++ library)
  • Newmat (an older but well-tested C++ matrix library)

Beyond that, your original question isn't really specific enough for better pointers.

like image 34
Dirk Eddelbuettel Avatar answered Oct 21 '22 17:10

Dirk Eddelbuettel