I found the solution pretty quickly, and after thinking it is best to share this link:
http://undocumentedmatlab.com/blog/changing-system-preferences-programmatically/
So what do you do:
Open the settings file and find the preference you want to read:
edit(fullfile(prefdir,'matlab.prf'));
CommandWindowSpacesPerTab=I4 EditorSpacesPerTab=I4, . , ( ).
, :
com.mathworks.services.Prefs.get<type>Pref(<pref-name>)
:
>> com.mathworks.services.Prefs.getIntegerPref('EditorSpacesPerTab')
ans =
4
: Matlab
: -, . ..: , , , . 0. :
if loadedpref==0
set default
end
EDIT2: matlab linux, ( 8). , :
function retval = isCommandWindowOpen()
jDesktop = com.mathworks.mde.desk.MLDesktop.getInstance;
retval = ~isempty(jDesktop.getClient('Command Window'));
end