|
1 | 1 | # Magic Commands for MATLAB Kernel |
2 | 2 |
|
3 | | -You can use magic commands with the MATLAB kernel. You can use the predefined magic commands in this folder, and you can implement your own by following the steps below. |
| 3 | +This guide shows how to use magic commands with the MATLAB kernel for added functionality. |
4 | 4 |
|
5 | 5 | ## Get Started |
6 | 6 |
|
7 | | -Magic commands for the MATLAB kernel are prefixed with two percentage symbols `%%` without whitespaces. For example, to list available magic commands, run `%%lsmagic` |
| 7 | +Magic commands for the MATLAB kernel are prefixed with two percentage symbols `%%` without whitespaces. For example, to list available magic commands, run `%%lsmagic`. To read the documentation of a magic command, use the help command `?` or `help`, for example `%%lsmagic?` or `%%help lsmagic`. |
8 | 8 |
|
9 | | -Note that magic commands will only work at the beginning of cells, and will not work with MATLAB variables. |
10 | | - |
11 | | -The magic commands `help` and `file` accept additional parameters. For example, to display information about a magic command, run `%%help` followed by the name of the magic as an argument: `%%help time` |
| 9 | +Note that magic commands only work at the beginning of cells. |
12 | 10 |
|
13 | 11 | This table lists the predefined magic commands you can use: |
14 | 12 |
|
15 | 13 |
|
16 | 14 | |Name|Description|Additional Parameters|Constraints|Example command| |
17 | 15 | |---|---|---|---|---| |
18 | | -|lsmagic|List predefined magic commands.|||`%%lsmagic`| |
19 | | -|help|Display information about provided magic command. | Name of magic command.|| `%%help file`| |
20 | | -|time|Display time taken to execute a cell.|||`%%time`| |
21 | | -|file|Save contents of cell as a file in the notebook folder. You can use this command to define and save new functions. For details, see the section below on how to [Create New Functions Using the %%file Magic Command](#create-new-functions-using-the-the-file-magic-command)|Name of saved file|The file magic command will save the contents of the cell, but not execute them in MATLAB|`%%file myfile.m`| |
| 16 | +|`?` and `help`| Display documentation of given magic command.|Name of magic command.||`%%lsmagic?` or `%%help lsmagic`| |
| 17 | +|`lsmagic`|List predefined magic commands.|||`%%lsmagic`| |
| 18 | +|`time`|Display time taken to execute a cell.|||`%%time`| |
| 19 | +|`file`|Save contents of cell as a file in the notebook folder. You can use this command to define and save new functions. For details, see the section below on how to [Create New Functions Using the %%file Magic Command](#create-new-functions-using-the-the-file-magic-command)|Name of saved file.|The file magic command will save the contents of the cell, but not execute them in MATLAB.|`%%file myfile.m`| |
22 | 20 |
|
23 | 21 |
|
24 | 22 | To request a new magic command, [create an issue](https://github.com/mathworks/jupyter-matlab-proxy/issues/new/choose). |
|
0 commit comments