Skip to main content

No project description provided

Project description

Prerequisites

Install Jupyter Notebook and the Matlab engine for Python.

Installation

Install using:

$ pip install matlab_kernel

or pip install git+https://github.com/Calysto/matlab_kernel for the dev version.

To use the kernel, run one of:

$ jupyter notebook
# In the notebook interface, select Matlab from the 'New' menu
$ jupyter qtconsole --kernel matlab
$ jupyter console --kernel matlab

To remove from kernel listings:

$ jupyter kernelspec remove matlab

Configuration

The kernel can be configured by adding an matlab_kernel_config.py file to the jupyter config path. The MatlabKernel class offers plot_settings as a configurable traits. The available plot settings are: ‘format’, ‘backend’, ‘width’, ‘height’, and ‘resolution’.

cat ~/.jupyter/matlab_kernel_config.py
c.MatlabKernel.plot_settings = dict(format='svg')

Troubleshooting

Kernel Times Out While Starting

If the kernel is not starting, try running the following from a terminal.

python -m matlab_kernel.check

Please include that output if opening an issue.

Kernel is Not Listed

If the kernel is not listed as an available kernel, first try the following command:

python -m matlab_kernel install --user

If the kernel is still not listed, verify that the following point to the same version of python:

which python  # use "where" if using cmd.exe
which jupyter

Additional information

The Matlab kernel is based on MetaKernel, which means it features a standard set of magics. For a full list of magics, run %lsmagic in a cell.

A sample notebook is available online.

A note about plotting. After each call to Matlab, we ask Matlab to save any open figures to image files whose format and resolution are defined using the %plot magic. The resulting image is shown inline in the notebook. You can use %plot native to raise normal Matlab windows instead.

Advanced Installation Notes

We automatically install a Jupyter kernelspec when installing the python package. This location can be found using jupyter kernelspec list. If the default location is not desired, you can remove the directory for the octave kernel, and install using python -m matlab_kernel install. See python -m matlab_kernel install --help for available options.

It has been reported that Matlab version 2016b works fine. However, Matlab 2014b does not work with Python 3.5.

Development

Install the package locally:

$ pip install -e .
$ python -m matlab_kernel install

As you make changes, test them in a notebook (restart the kernel between changes).

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

matlab_kernel-0.16.11.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

matlab_kernel-0.16.11-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file matlab_kernel-0.16.11.tar.gz.

File metadata

  • Download URL: matlab_kernel-0.16.11.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.6.0.post20200814 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5

File hashes

Hashes for matlab_kernel-0.16.11.tar.gz
Algorithm Hash digest
SHA256 93a58dda4d865a1cb3c9f1f9cdf5786a4aed09467bdf3e8d089124a7900fd73e
MD5 36cca54069308981348df6d85c766f5f
BLAKE2b-256 d2605f07e6770b5b3d1629b24d7d7b76d9313f85f152a7524ea3d34f1447c171

See more details on using hashes here.

Provenance

File details

Details for the file matlab_kernel-0.16.11-py3-none-any.whl.

File metadata

  • Download URL: matlab_kernel-0.16.11-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.6.0.post20200814 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5

File hashes

Hashes for matlab_kernel-0.16.11-py3-none-any.whl
Algorithm Hash digest
SHA256 a3a293e6f54fd1e025f4a17c5d48d3ac27d988a5454e60b353828991576d9bf7
MD5 338544addb5788fc998cde642ab01af5
BLAKE2b-256 feb6b5b1fde01cf83cafa2ca149adc5a5f1d0adee8b1e93a15b2a36ae35607d9

See more details on using hashes here.

Provenance

Supported by

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