Matlab Jupyter Notebook的Point Kernel [英] Point Kernel for Jupyter Notebook at Matlab
问题描述
我正在尝试让Jupyter Notebook与Matlab一起使用.我发现了一个非常有用的博客文章,这使我明白了就能够创建MATLAB笔记本而言.博客文章提出了以下步骤:
I am trying to get Jupyter Notebook to work with Matlab. I found a very helpful blog post about this which got me as far as being able to create a MATLAB notebook. The blog post proposes the following steps:
- 下载并安装Anaconda.
- 安装Python软件包
pymatbridge
和matlab_kernel
. -
通过在终端中键入以下内容来定义MATLAB可执行文件的路径:
- Download and install Anaconda.
- Install the Python packages
pymatbridge
andmatlab_kernel
. Define the path to the MATLAB executable by typing the following in a terminal:
echo "export MATLAB_EXECUTABLE=/Applications/MATLAB_2015b.app/bin/matlab" >> ~/.bash_profile.
重新启动终端.然后可以从Jupyter Notebook使用MATLAB.
Restart terminal. Then using MATLAB from a Jupyter Notebook should work.
我的问题是第三步,那就是将内核指向MATLAB可执行文件.它是为使用Mac的用户编写的,而我使用的是Windows10.对于在Windows上翻译"此步骤所做的工作,我不太熟悉.这是Mac上的说明:
My issue is with the third step, which is to point the kernel to the MATLAB executable. It is written for someone using a Mac, and I am on Windows 10. I'm not familiar enough with what is being done here to "translate" this step for Windows. Here are the instructions for a Mac:
对于在Windows 10中完成此步骤的任何建议,我将深表感谢.
I would deeply appreciate any suggestions on how to accomplish this step in Windows 10.
推荐答案
执行命令
echo "export MATLAB_EXECUTABLE=/Applications/MATLAB_2015b.app/bin/matlab" >> ~/.bash_profile
终端中的
会添加文本
in the terminal appends the text
export MATLAB_EXECUTABLE=/Applications/MATLAB_2015b.app/bin/matlab
到文件~/.bash_profile
.每次在OS X上打开终端时都会加载此文件.export
命令用于创建环境变量.因此,使用此命令,将创建环境变量MATLAB_EXECUTABLE
并具有值/Applications/MATLAB_2015b.app/bin/matlab
.
to the file ~/.bash_profile
. This file is loaded every time you open a terminal on OS X. The export
command is used to create an environment variable. So with this command, the environment variable MATLAB_EXECUTABLE
is created and has the value /Applications/MATLAB_2015b.app/bin/matlab
.
matlab_kernel
模块需要此环境变量,如其文档中所述
This environment variable is needed by the matlab_kernel
module, as described in its documentation.
要在Windows(7+)上设置环境变量,可以使用setx
命令,如
To set an environment variable on Windows (7+), you can use the setx
command, as described in this question on SuperUser. Thus, instead of the echo ...
line, you should call
setx MATLAB_EXECUTABLE "C:\Program Files (x86)\MATLAB\R2015b\bin\matlab.exe"
请注意,您将需要管理员权限.
Note that you'll need admin rights for that.
这篇关于Matlab Jupyter Notebook的Point Kernel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!