MATLAB

Key Features

  • High-level language for numerical computation, visualization, and application development
  • Interactive environment for iterative exploration, design, and problem solving
  • Mathematical functions for linear algebra, statistics, Fourier analysis, filtering, optimization, numerical integration, and solving ordinary differential equations
  • Built-in graphics for visualizing data and tools for creating custom plots
  • Development tools for improving code quality and maintainability and maximizing performance
  • Tools for building applications with custom graphical interfaces
  • Functions for integrating MATLAB based algorithms with external applications and languages such as C, Java, .NET, and Microsoft® Excel®

Numeric Computation

MATLAB provides a range of numerical computation methods for analyzing data, developing algorithms, and creating models. The MATLAB language includes mathematical functions that support common engineering and science operations. Core math functions use processor-optimized libraries to provide fast execution of vector and matrix calculations.

Available methods include:

  • Interpolation and regression
  • Differentiation and integration
  • Linear systems of equations
  • Fourier analysis
  • Eigenvalues and singular values
  • Ordinary differential equations (ODEs)
  • Sparse matrices

MATLAB add-on products provide functions in specialized areas such as statistics, optimization, signal analysis, and machine learning.

Analyzing and visualizing data using the MATLAB desktop.
Enlarge Analyzing and visualizing data using the MATLAB desktop. The MATLAB environment also lets you write programs and develop algorithms and applications.

Data Analysis and Visualization

MATLAB provides tools to acquire, analyze, and visualize data, enabling you to gain insight into your data in a fraction of the time it would take using spreadsheets or traditional programming languages. You can also document and share your results through plots and reports or as published MATLAB code.

Analyzing and Visualizing Data with MATLAB 3:26
Explore, visualize, and model your data with MATLAB®.

Acquiring Data

MATLAB lets you access data from files, other applications, databases, and external devices. You can read data from popular file formats such as Microsoft Excel; text or binary files; image, sound, and video files; and scientific files such as netCDF and HDF. File I/O functions let you work with data files in any format.

Using MATLAB with add-on products, you can acquire data from hardware devices, such as your computer's serial port or sound card, as well as stream live, measured data directly into MATLAB for analysis and visualization. You can also communicate with instruments such as oscilloscopes, function generators, and signal analyzers.

A mixed numeric and text file for import into MATLAB using the Import Tool.
Enlarge A mixed numeric and text file for import into MATLAB using the Import Tool. MATLAB automatically generates a script or function to import the file programmatically.

Analyzing Data

MATLAB lets you manage, filter, and preprocess your data. You can perform exploratory data analysis to uncover trends, test assumptions, and build descriptive models. MATLAB provides functions for filtering and smoothing, interpolation, convolution, and fast Fourier transforms (FFTs). Add-on products provide capabilities for curve and surface fitting, multivariate statistics, spectral analysis, image analysis, system identification, and other analysis tasks.

Fitting a surface to data with a custom model using MATLAB and Curve Fitting Toolbox.
Enlarge Fitting a surface to data with a custom model using MATLAB and Curve Fitting Toolbox.

Visualizing Data

MATLAB provides built-in 2-D and 3-D plotting functions, as well as volume visualization functions. You can use these functions to visualize and understand data and communicate results. Plots can be customized either interactively or programmatically.

The MATLAB plot gallery provides examples of many ways to display data graphically in MATLAB. For each example, you can view and download source code to use in your MATLAB application.

Editing the title of a surface contour plot using the MATLAB interactive plotting environment.
Enlarge Editing the title of a surface contour plot using the MATLAB interactive plotting environment.

Documenting and Sharing Results

You can share results as plots or complete reports. MATLAB plots can be customized to meet publication specifications and saved to common graphical and data file formats.

You can automatically generate a report when you execute a MATLAB program. The report contains your code, comments, and program results, including plots. Reports can be published in a variety of formats, such as HTML, PDF, Word, or LaTeX.

MATLAB program published as HTML using the MATLAB Editor.
Enlarge MATLAB program (left) published as HTML (right) using the MATLAB Editor. Results that display in the Command Window or as plots are captured and included, and the code comments are turned into section headings and body text in the HTML.

Programming and Algorithm Development

MATLAB provides a high-level language and development tools that let you quickly develop and analyze algorithms and applications.

Programming and Developing Algorithms with MATLAB 4:32
Write programs and develop algorithms using the high-level language and development tools in MATLAB®.

The MATLAB Language

The MATLAB language provides native support for the vector and matrix operations that are fundamental to solving engineering and scientific problems, enabling fast development and execution.

With the MATLAB language, you can write programs and develop algorithms faster than with traditional languages because you do not need to perform low-level administrative tasks such as declaring variables, specifying data types, and allocating memory. In many cases, the support for vector and matrix operations eliminates the need for for-loops. As a result, one line of MATLAB code can often replace several lines of C or C++ code.

MATLAB provides features of traditional programming languages, including flow control, error handling, and object-oriented programming (OOP). You can use fundamental data types or advanced data structures, or you can define custom data types.

You can produce immediate results by interactively executing commands one at a time. This approach lets you quickly explore multiple options and iterate to an optimal solution. You can capture interactive steps as scripts and functions to reuse and automate your work.

MATLAB add-on products provide built-in algorithms for signal processing and communications, image and video processing, control systems, and many other domains. By combining these algorithms with your own, you can build complex programs and applications.

A communications algorithm that generates 1024 random bits, convert the vector to a transmitted signal, adds complex Gaussian noise, and plots the result in nine lines of MATLAB code.
Enlarge A communications algorithm that generates 1024 random bits, converts the vector to a transmitted signal, adds complex Gaussian noise, and plots the result in nine lines of MATLAB code.

Development Tools

MATLAB includes a variety of tools for efficient algorithm development, including:

  • Command Window - Lets you interactively enter data, execute commands and programs, and display results
  • MATLAB Editor - Provides editing and debugging features, such as setting breakpoints and stepping through individual lines of code
  • Code Analyzer - Automatically checks code for problems and recommends modifications to maximize performance and maintainability
  • MATLAB Profiler - Measures performance of MATLAB programs and identifies areas of code to modify for improvement

Additional tools compare code and data files, and provide reports showing file dependencies, annotated reminders, and code coverage.

MATLAB program running in debug mode to diagnose problems.
Enlarge MATLAB program running in debug mode to diagnose problems.

Integration with Other Languages and Applications

You can integrate MATLAB applications with those written in other languages. From MATLAB, you can directly call code written in C, C++, Java, and .NET. Using the MATLAB engine library, you can call MATLAB code from C, C++, or Fortran applications.

Performance

MATLAB uses processor-optimized libraries for fast execution of matrix and vector computations. For general-purpose scalar computations, MATLAB uses its just-in-time (JIT) compilation technology to provide execution speeds that rival those of traditional programming languages.

To take advantage of multicore and multiprocessor computers, MATLAB provides many multithreaded linear algebra and numerical functions. These functions automatically execute on multiple computational threads in a single MATLAB session, enabling them to execute faster on multicore computers.

You can take further advantage of multicore desktop and other high-performance computing resources such as GPUs and clusters with add-on parallel computing products. These products provide high-level constructs that let you parallelize applications with only minor changes to MATLAB code.

Parallel Computing
Learn about how parallel computing solutions can speed up your large-scale data processing projects.

Application Development and Deployment

MATLAB tools and add-on products provide a range of options to develop and deploy applications. You can share individual algorithms and applications with other MATLAB users or deploy them royalty-free to others who do not have MATLAB.

Developing and Deploying Applications with MATLAB 3:51
Develop and share MATLAB® applications as code, executables, or software components.

Designing Graphical User Interfaces

Using GUIDE (Graphical User Interface Development Environment), you can lay out, design, and edit custom graphical user interfaces. You can include common controls such as list boxes, pull-down menus, and push buttons, as well as MATLAB plots. Graphical user interfaces can also be created programmatically using MATLAB functions.

GUIDE layout of a wind analysis user interface and the completed interface.
Enlarge GUIDE layout of a wind analysis user interface (top) and the completed interface (bottom).

Deploying Applications

To distribute an application directly to other MATLAB users, you can package it as a MATLAB app, which provides a single file for distribution. Apps automatically install in the MATLAB apps gallery for easy access.

To share applications with others who do not have MATLAB, you can use application deployment products. These add-on products automatically generate standalone applications, shared libraries, and software components for integration in C, C++, Java, .NET, and Excel environments. The executables and components can be distributed royalty-free.

MATLAB Production Server™ lets you run MATLAB programs packaged with MATLAB Compiler™ within your production systems, enabling you to incorporate numerical analytics in web, database, and enterprise applications.

MATLAB Compiler Overview 1:31
Build standalone applications and software components from MATLAB® programs using MATLAB® Compiler™

Generating C Code

You can use MATLAB Coder to generate standalone C code from MATLAB code. MATLAB Coder supports a subset of the MATLAB language typically used by design engineers for developing algorithms as components of larger systems. This code can be used for standalone execution, for integration with other software applications, or as part of an embedded application.

MATLAB Production Server™ lets you run MATLAB programs packaged with MATLAB Compiler™ within your production systems, enabling you to incorporate numerical analytics in web, database, and enterprise applications.
MATLAB code and code generation report showing generated C code.
Enlarge MATLAB code (left) and code generation report (right) showing generated C code.