1

Is there's away to convert the built-in functions that doesn't have a .m file to C++ I'm read in some paper that neither the Matlab compiler nor the Matlab coder could convert it so I'm wondering those seem to be the most basic functions is there's another way to convert it or perhaps a C++ library with its equivalent

Amro
  • 123,847
  • 25
  • 243
  • 454
Scarnet
  • 738
  • 2
  • 11
  • 36
  • 1
    I would guess that exaclty the implementation of these functions is what mathworks would describe as intellectual property. – PlasmaHH Jan 21 '14 at 10:49
  • It seems to me that every function in Matlab has a corresponding `.m` file. What function is missing `.m` file? – herohuyongtao Jan 21 '14 at 10:50
  • they don't actually miss its there but contains comments only – Scarnet Jan 21 '14 at 10:56
  • good question. i am looking for a c++ code for the matrix inversion operator ` \ ` in Matlab that does ` A\b `. it will be really helpful if there is a code available – Guddu Jan 21 '14 at 11:00
  • 1
    @Guddu LAPACK has functions for inverting a matrix. As I recall Matlab uses LAPACK for basic operations behind the scenes. – remus Jan 21 '14 at 12:01
  • 1
    In this case, MLDIVIDE is built from pieces of LAPACK, packaged up into a convenient form. There's some details about the overall pattern of MLDIVIDE here: http://www.mathworks.co.uk/help/matlab/math/systems-of-linear-equations.html#brs10rz-1 – Edric Jan 21 '14 at 12:53
  • 1
    See this: http://stackoverflow.com/a/18553768 – Amro Jan 22 '14 at 16:35
  • thanks i will check these links out – Guddu Jan 28 '14 at 20:10

2 Answers2

1

Check the Boost C++ Library (which also contains ode solvers and many other things) or LAPACK (for linear algebra operations).

remus
  • 2,635
  • 2
  • 21
  • 46
1

For deployment solutions, MathWorks publishes lists of supported toolboxes and functions by each product: MATLAB Coder and MATLAB Compiler

Amro
  • 123,847
  • 25
  • 243
  • 454
  • You can either use the MATLAB compiler, like Amro noted, or use a third party alternative, or you could try opening the code for the built-in MATLAB functions and replicating it in C. Note that it's not really well commented, won't be a trivial task, and you may be violating copyright or a licensing agreement by doing so. – Cloud Jan 22 '14 at 16:56
  • They both support MATLAB built functions? – herohuyongtao Jan 22 '14 at 17:06
  • Doesn't matter if the functions are implemented as builtins or M-files, if they are listed in those pages, then they are supported – Amro Jan 22 '14 at 17:10