The problem is just to start matlab without using the personal startup.m (et finish.m) file of the user, and for all platforms (not only Windows). I am developing a python app where I need to do somethings in matlab and catch the result (without using intermediate file, etc. I try to be as simple as possible). It will be easier to use the standard output from matlab, but in this case there are the usual starting Matlab message (from matlab_path/VersionInfo.xml file) all stuffs that can generate a display, from the user startup.m file. So It will be nice if a special matlab option exist (like -noStartupFileExecution as proposed by Matthias above) to start matlab in the "just after install way" (i.e. the default startup.m, finish.m, default path etc ...). Because right now, I need to use a workaround like the one below to do something that would be very easy to do if this option existed!
I use the python subprocess library to deal with the call system, stdout, stderr, etc ... So this is multiplatforms (I guess, because I develop only on real OS, so Linux and MacOS ;-
As an example a way to ask the version of matlab knowing the matlab_path and the spm path. I use the stderr possibility of fprintf to overcome the statup.m, finish.m, etc that I discussed above ...
matlab_path -nodisplay -nodesktop -nosplash -singleCompThread -r "addpath(spm_path); [name, ~]=spm('Ver'); fprintf(2, '%s', name(4:end)); exit" > /dev/null