Limitations
Added 30 Jul 2008
For a long time there was criticism that because MATLAB is a proprietary product of The MathWorks, users are subject to vendor lock-in.[8] [9] Recently an additional tool called the MATLAB Builder under the Application Deployment tools section has been provided to deploy MATLAB functions as library files which can be used with .NET or Java application building environment. But the drawback is that the computer where the application has to be deployed needs MCR (MATLAB Component Runtime) for the MATLAB files to function normally. MCR can be distributed freely with library files generated by the MATLAB compiler.
MATLAB, like Fortran, Visual Basic and Ada, uses parentheses, e.g. y = f(x), for both indexing into an array and calling a function. Although this syntax can facilitate a switch between a procedure and a lookup table, both of which correspond to mathematical functions, a careful reading of the code may be required to establish the intent.
MATLAB lacks a package system, like those found in modern languages
such as Java and Python, where classes can be resolved unambiguously,
e.g. Java's java.lang.System.out.println(). In MATLAB,
all functions share the global namespace, and precedence of functions
with the same name is determined by the order in which they appear in
the user's MATLAB path and other subtle rules.[10]
As such, two users may experience different results when executing what
otherwise appears to be the same code when their paths are different.
Many functions have a different behavior with matrix and vector
arguments. Since vectors are matrices of one row or one column, this
can give unexpected results. For instance, function sum(A) where A is a matrix gives a row vector containing the sum of each column of A, and sum(v) where v is a column or row vector gives the sum of its elements; hence the programmer must be careful if the matrix argument of sum can degenerate into a single-row array.[11] While sum and many similar functions accept an optional argument to specify a direction, others, like plot,[12]
do not, and require additional checks. There are other cases where
MATLAB's interpretation of code may not be consistently what the user
intended[citation needed] (e.g. how spaces are handled inside brackets as separators where it makes sense but not where it doesn't, or backslash escape sequences which are interpreted by some functions like fprintf
but not directly by the language parser because it wouldn't be
convenient for Windows directories). What might be considered as a
convenience for commands typed interactively where the user can check
that MATLAB does what the user wants may be less supportive of the need
to construct reusable code.[citation needed]
Array indexing is one-based which is the common convention for matrices in mathematics, but does not accommodate any indexing convention of sequences that have zero or negative indices. For instance, in MATLAB the DFT (or FFT) is defined with the DC component at index 1 instead of index 0, which is not consistent with the standard definition of the DFT in any literature. This one-based indexing convention is hard coded into MATLAB, making it difficult for a user to define their own zero-based or negative indexed arrays to concisely model an idea having non-positive indices.
M-code written for a specific release of MATLAB often does not run with earlier releases. To give just one example: save('x','filename') saves the variable x in a file. The variable can be loaded with load('filename')
in the same MATLAB release. However, if saved with MATLAB version 7 or
later, it cannot be loaded with MATLAB version 6 or earlier. As
workaround, in MATLAB version 7 save('x','filename','-v6') generates a file that can be read with version 6. However, executing save('x','filename','-v6') in version 6 causes an error message.