MATLAB
Matrix Laboratory
- Pronunciation
- MAT-lab
In short
MATLAB is a matrix-based language and environment from MathWorks for numerical computing, used by engineers and scientists for data analysis and simulation.
What is MATLAB?
MATLAB started in the late 1970s as a teaching tool by Cleve Moler that gave students easy access to matrix libraries, and MathWorks was founded in 1984 to sell it. Its name, short for matrix laboratory, explains its design: almost everything is an array, and operations such as A * B or A' work on whole matrices at once.
Engineering is its home ground. Toolboxes add ready-made functions for signal and image processing, control systems, statistics, optimization, machine learning and more, and Simulink, its companion product, lets engineers model and simulate dynamic systems as block diagrams, from car braking systems to aircraft controls, and generate code for embedded hardware.
The MATLAB environment combines an editor, an interactive command window, plotting and live scripts that mix code, results and text. Code is vectorized by habit: instead of loops, you apply an operation to a whole vector, which is both shorter and faster.
A common misconception is that MATLAB is a general-purpose language like Python. It is proprietary and paid, with free access mainly through universities, and its strength is numerical engineering work. Many teams now use Python with NumPy and SciPy for similar tasks, and GNU Octave runs much MATLAB code for free. Note that arrays start at index 1.
Key takeaways
- MATLAB is a language and environment for numerical, matrix-based computing.
- It began in the late 1970s; MathWorks has sold it since 1984.
- Toolboxes and Simulink serve engineering fields such as control and signal processing.
- Vectorized code operates on whole arrays instead of looping.
- It is proprietary; Python with NumPy and GNU Octave are common alternatives.
Example
% Solve the linear system A*x = b
A = [4 -2 1; 3 6 -4; 2 1 8];
b = [12; -25; 32];
x = A \ b % backslash solves the system
% Vectorized: no loop needed
t = linspace(0, 2*pi, 200);
y = sin(t) .* exp(-t/3); % element-wise multiply with .*
plot(t, y, 'LineWidth', 2)
title('Damped sine wave')
xlabel('t'), ylabel('y')Readers ask
Is MATLAB free?
No. MATLAB requires a license, though many universities provide it to students. GNU Octave is a free program that runs a large share of MATLAB code.
MATLAB or Python?
MATLAB offers polished engineering toolboxes, Simulink and a consistent environment. Python is free, general-purpose and has a huge ecosystem with NumPy, SciPy and pandas. Industry fields built around Simulink tend to keep MATLAB.
What is Simulink?
A MathWorks tool for modeling and simulating dynamic systems with block diagrams instead of code. It is widely used in automotive, aerospace and control engineering, and can generate code for embedded systems.
See also
- PythonProgramming Languages, p. 26Python is a general-purpose, dynamically typed programming language known for readable syntax and wide use in data science, automation, and web backends.
- RProgramming Languages, p. 27R is a programming language and environment for statistics and data analysis, widely used in research for data visualization, statistical models and reports.
- JuliaProgramming Languages, p. 16Julia is a high-level, dynamically typed language for scientific and numerical computing, designed to be as easy to write as Python and as fast as C.
- FortranProgramming Languages, p. 12Fortran is the first widely used high-level language, created at IBM in 1957 for science and engineering and still used in high-performance computing.
- ArrayProgramming Fundamentals, p. 3An array is an ordered collection of values stored under one name, where each item is accessed by its numeric position, called an index, usually starting at 0.
- Machine LearningAI & Machine Learning, p. 27Machine learning is a branch of artificial intelligence in which computers learn patterns from data to make predictions instead of following hand-written rules.
Spotted a mistake or something missing on this page?Suggest an edit