File Exchange

image thumbnail

Insert a piece of code (a snippet) in the Matlab editor

version 1.4 (1.58 KB) by

Paste into the editor a code using the shortcuts toolbar.

7 Downloads

Updated

View License

You often use the same code, but you still don't remember it?
1. Copy the code of the file insert_snippet.m.

2. Create a new shortcut in Matlab.

3. Paste the code into 'Callback'.

4. Change the code in the 22th line.

5. Give a name to your shortcut in 'Label'.

6. Click 'Save'.

7. Click on the newly created shortcut to paste your code into the editor.

Comments and Ratings (3)

Great.
I created a Snippets dir, and changed your code so I could pass the name of the snippet file name to the function from the command window and it will paste the snippet in the right place. thanx

http://bit.ly/insert_snippet_matlab

Nicolas

Updates

1.4

Fix bug for new versions of Matlab.

1.3

Now the code does not add a variable in the workspace. Besides, a new line is introduces by the more usual character '\n'.

1.1

Fix minors bugs and give an example.

MATLAB Release
MATLAB 7.10 (R2010a)
Acknowledgements

Inspired: RobustCodeExpo2016

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video