MATLAB Answers

Diego
1

Assign a custom shortcut to keyboard-shortcut

Asked by Diego
on 1 Aug 2013
Latest activity Commented on by Matt Eicholtz
on 23 Sep 2016 at 18:56

Hello,

I've created a new shortcut on the bar on the top right with the following contents:

% Change Directory to Currently Selected File in Editor
cd(fileparts(matlab.desktop.editor.getActiveFilename));

Another has this:

% Open Explorer to Currently Selected File
winopen(fileparts(matlab.desktop.editor.getActiveFilename));

I use this quite frequently and am wondering if I can assign them to a keyboard shortcut. I can't seem to find them under prefrences-->keyboard..etc.

Thanks!

  0 Comments

Tags

Products

No products are associated with this question.

1 Answer

Answer by Sean de Wolski
on 1 Aug 2013
 Accepted answer

You can get keyboard mnemonics by holding the [alt] key (Windows, not sure about others) and either releasing it or waiting a second. The number or letter to complete the mnemonic will appear, press this key and it will run.

  2 Comments

Diego
on 1 Aug 2013

thank you that did it!

Matt Eicholtz
on 23 Sep 2016 at 18:56

Sean, do you know if it is possible to edit the keyboard shortcuts for the quick access toolbar? Say if I want to use Alt+C instead of Alt+1 for the first icon on the toolbar?

This answer makes me think it is not possible, but I hope it is.


Join the 15-year community celebration.

Play games and win prizes!

Learn more
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!