matlabundocumented-behavior

matlab evaluate current line (where cursor is)


How do I do the same as F9, but without marking the current line (e.g. with shift+home, then F9)?

Obviously this is purely for convenience sake - but something like shift-F9 or ctrl+F9 would be cool?

How to make that shortcut? Would any poweruser know?


Solution

  • It is not trivial to create you own action for a keyboard shortcut in Matlab (you can see predefined shortcuts in Preferences -> Keyboard -> Shortcuts). Check this discussion for help though

    Alternatively, if it works for you, you can easily select a line and then press F9. To quickly select a line, choose one of these steps:

    1. triple click anywhere on the line

    2. click on the space between the break-point gutter and the start of the line

    Mathworks link to selecting a whole line