Skip to main content

A better matlab -nodesktop

Project description

matREPLab

This unique python file enhances the classic matlab command window in a terminal application. you just have to launch matREPLab.py instead of matlab -nodesktop

This is very usefull when you want to code in editors different from the matlab native IDE (VS code, Sublime, Atom, emacs...) using the integrated terminals provided by those more advanced editors.

Quick start

make this file callable using, for example:

chmod 777 matREPLab.py

add an alias or add to your PATH the matlab binary in your ~/.bashrc or ~/.bash_profile (example for mac OS X):

PATH="/Applications/MATLAB_R2018b.app/bin:$PATH"

or

alias matlab="/Applications/MATLAB_R2018b.app/bin/matlab"

and execute it!

matREPLab.py

Requirements

  • Matlab
  • python 3.6+
  • python packages (installed via pip3 install package_name):
    • pygments
    • pexpect (often already installed)
    • prompt_toolkit
    • pathlib (often already installed)

Features

  • color syntaxing
  • go to errors (line and col) in files (VS code only for the moment)
  • Auto completion (use the file ~/.matREPLab_completion_result)
  • history (use the file ~/.matREPLab_history)
  • multi-line handling (a little bit cleaner than matlab -nodesktop)

Current validated environments and other equivalent contributions:

Should work on any Unix system (tested on Mac OS X and Ubuntu).

Working at least for Matlab 2016 to 2019. Does not work on Matlab 2020 because they removed access to the completion function. I may add a more basic solution to get completion results in this case, but it is not a priority.

To my knowledge only Calysto and imatlab (stange user name) implemented a jupyter kernel to improve matlab REPL in terminals:

If matREPLab works on your environment, you don't need to install MATLAB engine for Python R2016b+ contrary to these two other contributions, and you don't lose the debugging capabilities (dbstop is still working).

Usefull not well known Matlab functions:

To see variables in workspace:

>> workspace

To place breakspoints:

>> dbstop in myFile.m at line

To consult pretty documentation:

>> doc num2str

Limitations:

Output is printed when expression evaluation is finished (when the user get back the control). For long commands you can consult the created file ~/.matREPLab_live_log which is written in real time (and also contains the autocompletion calls)

Planned Enhancements:

  • a settings management to chose themes and options
  • check functionning on Linux and Windows system (via VS code)
  • common history with Matlab
  • special command for history monitoring
  • real-time outputs
  • integration in VS Code for breakpoints handling (and maybe more advanced stuff like debugging navigation and workspace visualization)

Aknowledgment:

This work has been possible thanks to the awesome pexpect project, prompt-toolkit project and pygments project.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

matreplab-0.3.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

matreplab-0.3-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file matreplab-0.3.tar.gz.

File metadata

  • Download URL: matreplab-0.3.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.5

File hashes

Hashes for matreplab-0.3.tar.gz
Algorithm Hash digest
SHA256 2d4da1c228d71aaeca464da22c1125f39de87f5c41eea5cabf330e7659e9eeea
MD5 1a9c9f1abb53b5f730a25e97744e0451
BLAKE2b-256 6757ee72b284598560b16b2c23127d5e3980cdbae651df07be44f0c1d61cbadd

See more details on using hashes here.

File details

Details for the file matreplab-0.3-py3-none-any.whl.

File metadata

  • Download URL: matreplab-0.3-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.5

File hashes

Hashes for matreplab-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5d4fdd3a8bf7ad29b297406167bcd983bfce50258cab3422ac5f8fc302aeb214
MD5 395d74f221143071bf23a58831212143
BLAKE2b-256 2f1dc4f5c00c531fcf3412a2775a4bd5972d8f3a5a815a3da275659176338ec2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page