GNU-devel ELPA - matlab-mode

matlab-mode Atom Feed

Description
Major mode for MATLAB(R) dot-m files
Latest
matlab-mode-6.3.0.20250530.124947.tar (.sig), 2025-May-30, 770 KiB
Maintainer
Eric M. Ludlam <eludlam@mathworks.com>, Uwe Brauer <oub@mat.ucm.es>, John Ciolfi <john.ciolfi.32@gmail.com>
Website
https://github.com/mathworks/Emacs-MATLAB-Mode
Browse ELPA's repository
CGit or Gitweb
Badge

To install this package from Emacs, use package-install or list-packages.

Full description

1. Emacs MATLAB-mode

MathWorks MATLAB® and GNU Emacs integration:

  1. matlab-mode for editing *.m files.
    • Edit MATLAB code with syntax highlighting and smart indentation.
    • Lint MATLAB code with fix-it's using the MATLAB Code Analyzer.
  2. Code navigation and more
  3. M-x matlab-shell for running and debugging MATLAB within Emacs (Unix only).

    • MATLAB command window errors are hyper-linked and files open in Emacs
    • Debugging support is available from the MATLAB menu.
    • matlab-shell uses company-mode for completions.

    See doc/matlab-shell-for-unix.org

  4. M-x matlab-shell to run remote Unix MATLAB within your local Emacs session.

    +----------------+                 +-----------------+
    | Local Computer |                 | Remote Computer |
    |                |<===============>|                 |
    |     Emacs      |      ssh        |      MATLAB     |
    +----------------+                 +-----------------+
    

    You use Emacs on your local computer to edit files on the remote computer, run and debug remote MATLAB in a matlab-shell in your local Emacs. See doc/remote-matlab-shell.org.

  5. M-x matlab-netshell for running MATLAB code on Microsoft Windows within Emacs using an attached MATLAB.

    +--------------- Emacs ----------------+         +------------  MATLAB  ------------+
    |                                      |         |                                  |
    | (1) M-x matlab-netshell-server-start |         | (2) connect to Emacs             |
    |                                      |<=======>| >> addpath <matlab-mode>/toolbox |
    | (3) Visit script *.m files and use   |         | >> emacsinit                     |
    |     "MATLAB -> Code Sections" menu   |         | >>                               |
    |     or the key bindings              |         |                                  |
    +--------------------------------------+         +----------------------------------+
    
  6. Code sections support for MATLAB script files. See doc/matlab-code-sections.org.
  7. Creation of scientific papers, theses, and documents using MATLAB and http://orgmode.org.
    • Org enables literate programming which directly supports reproducible research by allowing scientists and engineers to write code along with detailed explanations in natural language.
    • You author code plus natural language descriptive text in *.org files. When you evaluate MATLAB or other language code blocks within the *.org files, org inserts the results back into the *.org file.
    • You can combine multiple *.org files into one final document, thus enabling larger scientific documents.
    • See ./examples/matlab-and-org-mode/ to get started. This directory contains a PDF generated from ./examples/matlab-and-org-mode/matlab-and-org-mode.org.
  8. tlc-mode for editing *.tlc files. The Target Language Compiler (TLC) is part of Simulink® Coder™.

2. Installation

2.1. Install via ELPA or MELPA

Install via ELPA or MELPA. MELPA contains the latest. To install from MELPA, add to your ~/.emacs

(require 'package)
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t)

To install from either ELPA or MELPA

M-x RET list-packages RET

and click on matlab-mode to install.

2.2. Install from this repository

Build:

cd /path/to/Emacs-MATLAB-mode

# Build lisp and run tests (requires MATLAB executable):
make

# Alternatively, build lisp and run tests using a specific MATLAB executable:
make MATLAB_EXE=/path/to/matlab

# If desired, you can separate the building of lisp and running tests using:
make lisp
make tests
make tests MATLAB_EXE=/path/to/matlab # if using a specific MATLAB executable

Add the following to your ~/.emacs file:

(add-to-list 'load-path "/path/to/Emacs-MATLAB-mode")
(load-library "matlab-autoload")

3. MathWorks Products (https://www.mathworks.com)

Emacs MATLAB-mode is designed to be compatible with the last six years of MathWorks products and may support even older versions of MathWorks products.

5. Community Support

6. FAQ

8. Releases

See NEWS.org

Old versions

matlab-mode-6.3.0.20250529.135623.tar.lz2025-May-29 156 KiB
matlab-mode-6.3.0.20250528.210256.tar.lz2025-May-29 156 KiB
matlab-mode-6.3.0.20250527.135136.tar.lz2025-May-27 156 KiB
matlab-mode-6.3.0.20250523.165433.tar.lz2025-May-24 154 KiB
matlab-mode-6.3.0.20250519.162242.tar.lz2025-May-21 166 KiB
matlab-mode-6.3.0.20250507.150649.tar.lz2025-May-07 163 KiB
matlab-mode-6.3.0.20250422.131049.tar.lz2025-Apr-22 162 KiB
matlab-mode-6.3.0.20250331.193016.tar.lz2025-Apr-01 161 KiB
matlab-mode-6.3.0.20241224.134640.tar.lz2024-Dec-24 160 KiB
matlab-mode-6.3.0.20241208.165742.tar.lz2024-Dec-08 160 KiB

News

1. Next release

These are items that will appear in the next ELPA release. These items are available from MELPA.

  1. Added doc/matlab-netshell-for-windows.org. Commit b0222ac.

    
    +--------------- Emacs ----------------+         +------------  MATLAB  ------------+
    |                                      |         |                                  |
    | (1) M-x matlab-netshell-server-start |         | (2) connect to Emacs             |
    |                                      |<=======>| >> addpath <matlab-mode>/toolbox |
    | (3) Visit script *.m files and use   |         | >> emacsinit                     |
    |     "MATLAB -> Code Sections" menu   |         | >>                               |
    |     or the key bindings              |         |                                  |
    +--------------------------------------+         +----------------------------------+
    
    
  2. Setup imenu for *.tlc files. Commit 7d0d26a and e3e6952.
  3. Fix imenu for *.m files and added doc/matlab-imenu.org on using it. Commit a54d206.

    Now typing M-g i (or M-x imenu) when visiting a *.m file will let you quickly jump to function declarations.

  4. Indent first non-help comment. Commit a63e0fe.

    function b = foo
    % This is the help for function foo
    % which can span multiple lines.
    
        % This is a non-help comment for the following code
        b = 1;
    end
    
  5. MATLAB Language Server, matlabls, for code navigation, code completion, go to definition, find references, and more. See doc/matlab-language-server-lsp-mode.org. Commit e9ab4fb.
  6. Improved Emacs tramp remote M-x matlab-shell. Commit 64e1805.

    Prior to this commit, matlab-shell running through Emacs tramp partially. This commit enables remote matlab-shell and enables remote debugging, hyperlinks, etc. See remote-matlab-shell.org documentation.

  7. Remove font-lock-constant-face from help comments. Commit 1d935b3.

    A general guideline for help comments is to capitalize functions such as PLOT as references and matlab-mode used to make these a font-lock-constant-face inside of comments. However, often capital items are not references and make comments look bad, so removed these. Likewise, there were other uses of font-lock-constant-face that look odd, so removed these.

  8. Revamped MATLAB code sections script support issues. Commit e75ebf5 and others.
    • Added doc/matlab-code-sections.org.
    • MATLAB code sections is now a minor mode, matlab-sections-minor-mode which is automatically enabled when in a MATLAB script. A MATLAB script contains one or more MATLAB commands or

… …