matlab_run.vim : Run matlab script using Python for Windows users
| script karma
Downloaded by 778
Comments, bugs, improvements
script versions (upload new version)
|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.
1. Work for function file as well as script file, as long as the function does not require inputs.
2. 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)
3. It may take longer time than usual when you open an m file because it also starts Matlab.
4. DO NOT close the Matlab Command Window. It will close itself when you close your m files.
5. 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.
|Download the file and put in $vim/vimfiles/ftplugin.|
Click on the package to download.
ip used for rating: 18.104.22.168
||Polish the script a little bit.
In this version it won't open Matlab when you open an m file. But need to open Matlab before running scripts.
type ,o to open Matlab.
type ,r to run.
Certainly you could map to your favorite keys.
||This version does not add path. You can also run m files in different directory now.