scripting - How do I specify the MATLAB editor keybindings programmatically -


i want setup keyboard keybindings windows default set , @ startup using startup.m because want setting set on large number of systems.

the equivalent setting in preferences dialog is: matlab > keyboard > shortcuts > active settings: windows default set.

proposal of startup.m after suever's answer

see line 8

% todo set startup script in $home/documents/bin/matlab/startup.m in terminal  % commands here run @ startup etc startup.m % todo set user path relative $home/documents/bin/matlab/ %userpath('/home/masi/documents/bin/matlab/') % todo how set userpath outside matlab script in terminal?  % http://stackoverflow.com/a/38188945/54964 if ( not( com.mathworks.services.prefs.getstringpref('currentkeybindingset') == 'windows' ) )         com.mathworks.services.prefs.setstringpref('currentkeybindingset', 'windowsdefaultset.xml') end  % event errors else touchpad scroll !synclient horiztwofingerscroll=0 

matlab: 2016a
system: linux ubuntu 16.04

if want programmatically can using undocumented functions setting preferences.

com.mathworks.services.prefs.setstringpref('currentkeybindingset', 'windows') 

if want different keybinding, can set value explicitly preferences dialog , call following retrieve value.

com.mathworks.services.prefs.getstringpref('currentkeybindingset') 

this command should have run once per matlab installation placing within startup.m file may overkill , prevent users being able change default settings.


Comments

Popular posts from this blog

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -