Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are the matlab built-in functions written in some lower level language?

Tags:

c++

matlab

Why are the built-in functions in Matlab so much faster then the ones that you write yourself?

like image 752
Aamir Abro Avatar asked Oct 04 '12 18:10

Aamir Abro


People also ask

Is MATLAB a low level language?

MATLAB is a high-level language and interactive environment for numerical computation, visualization, and programming.

Is MATLAB a high-level or low level language?

MATLAB: The MATLAB programming language is part of the commercial MATLAB software [2] that is often employed in research and industry and is an example of a high-level “scripting” or “4th generation” language.

What language is MATLAB built on?

The MATLAB application is built around the MATLAB programming language. Common usage of the MATLAB application involves using the "Command Window" as an interactive mathematical shell or executing text files containing MATLAB code.

How is MATLAB different from other high-level language?

In MATLAB classes, there is no equivalent to C++ templates or Java generics. However, MATLAB is weakly typed and it is possible to write functions and classes that work with different types of data. MATLAB classes do not support overloading functions using different signatures for the same function name.


2 Answers

yes, matlab alikes usually use wrapper functions for linear algebra library routines written in a low level language (usually Fortran) such as BLAS,ATLAS or LAPACK.

you can read more about this in here

also see this question if you're curious how much overhead does function wrapping costs (basically none). results are for C++, python and numpy but I believe they are applied to matlab as well.

like image 183
none Avatar answered Nov 09 '22 17:11

none


In short, because they will be written in native code (C/C++), so that allows the developers access to assembler optimisations on the data, and also the ability to use SSE and similar to try and parallelise the operations within the CPU.

like image 45
slugonamission Avatar answered Nov 09 '22 17:11

slugonamission