View License

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

» Watch video

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

Join the 15-year community celebration.

Play games and win prizes!

» Learn more

5.0 | 2 ratings Rate this file 8 Downloads (last 30 days) File Size: 1.58 KB File ID: #41704 Version: 1.4
image thumbnail

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



10 May 2013 (Updated )

Paste into the editor a code using the shortcuts toolbar.

| Watch this File

File Information

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.

Required Products MATLAB
MATLAB release MATLAB 7.10 (R2010a)
MATLAB Search Path
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (2)
09 Aug 2016 Shay Ben-Sasson

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

10 Sep 2015 Nicolas  
10 May 2013 1.1

Fix minors bugs and give an example.

29 Aug 2013 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'.

12 Nov 2014 1.4

Fix bug for new versions of Matlab.

Contact us