Be the first to rate this file! 2 Downloads (last 30 days) File Size: 199.85 KB File ID: #24128

Evaluate Selected Code from any Application in MATLAB

by Hamid Satarboroujeni

 

15 May 2009

When running this tool will enable you to evaluate selected code from any application in MATLAB.

| Watch this File

File Information
Description

In recent releases of MATLAB you can select MATLAB code in the Editor or documentation and press F9 to evaluate it in MATLAB. To expand this functionality to outside MATLAB, I created a tool called RunSelectedCodeInMatlab. It works in two modes:

Print mode (F9): similar to what is available in MATLAB. It prints the selected code, line by line at MATLAB command.

Hidden mode (F10): The code won’t be printed at MATLAB command and won’t show up in the command history but variables are created in the workspace and outputs are shown (figures, untruncated outputs, etc.,).
This mode requires MATLAB Automation Server to be enabled and when you run the tool it will prompt to enable the Automation Server for you.

To use the tool:
1- Download and run it.

2- You must have MATLAB open when you run it. It will ask to enable MATLAB Automation Server for you. This is needed for the “hidden” mode to work.

3- Now select MATLAB code in any application (web browser, PDFs, word docs, etc.). You can select multiple lines of code.

4- Press F9 (for the print mode) or F10 (for the hidden mode).

MATLAB release MATLAB 7.8 (R2009a)
Other requirements Should work with all versions of MATLAB.
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
evaluate code Hamid Satarboroujeni 15 May 2009 16:48:55
outside matlab Hamid Satarboroujeni 15 May 2009 16:48:56
automation server Hamid Satarboroujeni 15 May 2009 16:48:56
automation server Karsten 11 Mar 2011 08:49:00
evaluate code Karsten 11 Mar 2011 08:49:04

Contact us at files@mathworks.com