Let me clarify my question: it is not to open a file in an external editor by using a matlab command / script; it is to set an external program as a text editor in the matlab preferences so that any (not only one particular file) matlab script file opened from Matlab gets opened in the external text editor instead of Matlab's own Editor. As mentioned already, just setting an external text editor program in the "Preferences > Editor/Debugger > Text editor" field works, but what doesn't work is adding commandline arguments in that field since Matlab apparently quotes the entire text in that text box. I also tried:
s = settings
s.matlab.editor.OtherEditor.PersonalValue = '"C:\Program Files\Emacs\x86_64\bin\emacsclientw.exe" -n -c -a ""'
but that doesn't work either.