Matlab functionality missing

Felix W.
2012-12-08
2012-12-10
  • Felix W.
    Felix W.
    2012-12-08

    I would really like to use notepad++ instead of matlabs standard editor,
    but so far I haven't found out how to evaluate the code easily, without that I can't use it productively.
    I just want to hit F5 to evaluate the whole code or F9 for a selection. Is this possible with a plugin or something?

     
  • It is possible to "automate" Matlab, to execute what you want. First start Matlab and be certain it acts as an automation server, with the Matlab command enableservice('AutomationServer',true). Then you can use anything that can communicate with a COM interface, for example the Python Script plugin. In Python, you need to first import win32com.client and then open the communication using matlab = win32com.client.Dispatch("Matlab.Application"). Once this is done, you can execute the text in the current Notepad++ editor with print matlab.Execute(editor.getText()), or current selection with print matlab.Execute(editor.getSelText()) (note that text results will be displayed in the Python console, not the Matlab command window).
    You can put these Python commands in scripts, configure Python Script plugin to add them to the menu and toolbar, and configure Notepad++ shortcuts for the menu items.