-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
41bbb13
commit 6ff852c
Showing
3 changed files
with
37 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,38 @@ | ||
# MATLAB Kernel for Jupyter | ||
|
||
This module is a part of the `jupyter-matlab-proxy` package and it provides a Jupyter kernel for the MATLAB language. | ||
This page provides a technical overview of the MATLAB kernel used in the [MATLAB Integration for Jupyter](https://github.com/mathworks/jupyter-matlab-proxy). | ||
|
||
## Usage | ||
|
||
Upon successful installation of `jupyter-matlab-proxy`, your Jupyter environment should present several options for using MATLAB in Jupyter. | ||
|
||
Click on `MATLAB Kernel` to create a Jupyter notebook for MATLAB. | ||
After installing the MATLAB Integration for Jupyter, your Jupyter environment shows different options for using MATLAB in Jupyter. Click `MATLAB Kernel` to start a Jupyter notebook. | ||
|
||
|Jupyter Notebook| JupyterLab | | ||
|--|--| | ||
|<p align="center"><img width="200" src="https://github.com/mathworks/jupyter-matlab-proxy/raw/main/img/classic-jupyter-kernel.png"></p> | <p align="center"><img width="500" src="https://github.com/mathworks/jupyter-matlab-proxy/raw/main/img/jupyterlab_kernel_icon.png"></p> | | ||
|
||
## Architecture | ||
|
||
|| | ||
|-| | ||
|
||
**Key takeaways:** | ||
|
||
* When a notebook is opened, a new kernel is created for it. | ||
|
||
* When the first execution request is made the following occurs: | ||
* A licensing screen is presented if this information has not been provided previously. | ||
* A MATLAB process is launched by Jupyter if one has not been launched previously. | ||
|
||
* Every subsequent notebook does **not** ask for licensing information or launch a new MATLAB process. | ||
## Technical Overview | ||
|
||
* Every notebook communicates with MATLAB through the Jupyter notebook server. | ||
|
||
* A notebook can be thought of as another view into the MATLAB process. | ||
* Any variables or data created through the notebook manifests in the spawned MATLAB process. | ||
* This implies that all notebooks access the same MATLAB workspace, and users must keep this in mind when working with multiple notebooks. | ||
|<p align="center"><img width="600" src="https://github.com/mathworks/jupyter-matlab-proxy/raw/main/img/kernel-architecture.png"></p>| | ||
|--| | ||
|The diagram above illustrates that multiple Jupyter notebooks communicate with a shared MATLAB process, through the Jupyter notebook server.| | ||
|
||
* If simultaneous execution requests are made from two notebooks, they are processed by MATLAB in a **first-in, first-out basis**. | ||
Start a Jupyter notebook to create a MATLAB kernel. When you run MATLAB code in a notebook for the first time, you see a licensing screen to enter your MATLAB license details. If a MATLAB process is not already running, Jupyter will start one. | ||
|
||
* Kernel interrupts can be used to interrupt the execution that is currently being processed by MATLAB. | ||
Multiple notebooks share the same MATLAB workspace. MATLAB processes commands from multiple notebooks in on a first-in, first-out basis. | ||
|
||
**Note**: If cells from multiple notebooks are being run at the same time, the execution request that gets interrupted may not be the one from which the interrupt was requested. | ||
You can use kernel interrupts to stop MATLAB from processing a request. Remember that if cells from multiple notebooks are being run at the same time, the execution request you interrupt may not be from the notebook where you initated the interrupt. | ||
|
||
## Key Features | ||
* Tab completion | ||
* Execution of MATLAB code | ||
* Rich outputs including: | ||
* Inline static plot images | ||
* LaTeX representation for symbolic expressions | ||
* **For MATLAB R2022b and later:** Local functions can be defined at the end of a cell for use in the same cell | ||
<p><img src="https://github.com/mathworks/jupyter-matlab-proxy/raw/main/img/local_functions.png"></p> | ||
* **For MATLAB R2024a and later:** Tables are formatted using HTML instead of ASCII | ||
| Before R2024a | After R2024a | | ||
|--|--| | ||
|<p align="center"><img width="550" src="https://github.com/mathworks/jupyter-matlab-proxy/raw/main/img/tables_before_r2024a.png"></p> | <p align="center"><img width="500" src="https://github.com/mathworks/jupyter-matlab-proxy/raw/main/img/tables_after_r2024a.png"></p> | | ||
|
||
## Limitations | ||
Please refer to this [README](https://github.com/mathworks/jupyter-matlab-proxy#limitations) file for a listing of the current limitations. | ||
For limitations of the MATLAB kernel, see [Limitations](https://github.com/mathworks/jupyter-matlab-proxy/blob/main/Limitations.md). | ||
|
||
## Feedback | ||
|
||
We encourage you to try this repository with your environment and provide feedback. | ||
If you encounter a technical issue or have an enhancement request, create an issue [here](https://github.com/mathworks/jupyter-matlab-proxy/issues) or send an email to `[email protected]` | ||
To request an enhancement or technical support, [create a GitHub issue](https://github.com/mathworks/jupyter-matlab-proxy/issues) or send an email to `[email protected]`. | ||
|
||
---- | ||
|
||
Copyright 2023 The MathWorks, Inc. | ||
Copyright 2023-2024 The MathWorks, Inc. | ||
|
||
---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters