Ⅰ. 插件描述
Run matlab script using Python for Windows usersⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin '/matlab-run-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle '/matlab-run-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug '/matlab-run-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/vim-scripts/matlab_run.vim
Ⅳ. 文档说明
I no longer use Matlab nor Windows so I won't be able to improve this script any more. Feel free to take over it and improve it.
Required Python and its module win32com.
Only in win32 platform.
Known successful versions
WinXP, Python 2.4, Vim 7, Matlab 6.5
Please refer to tip#1298: http://www.vim.org/tips/tip.php?tip_id=1298
(Thanks for the improvement from the comments.)
How to use:
Type ,r then it will save your file and run the file in Matlab. The output from Matlab will be displayed in the current window.
Remarks:
- Work for function file as well as script file, as long as the function does not require inputs.
- It will automatically add the path of your file using addpath in Matlab. If you want to remove it you need to use rmpath in Matlab to do so manually. (Ignore this for version 1.1)
- It may take longer time than usual when you open an m file because it also starts Matlab.
- DO NOT close the Matlab Command Window. It will close itself when you close your m files.
- For those of you who don't have Python but consider to install it, I recommand the enthought edition (http://code.enthought.com/enthon/) which includes pywin32. As a Matlab user, you may also find scipy and numpy very useful in the future.