MATLAB: Running external commands without going through a shell

MATLABshellsystemunix

The Matlab system() command allows the user to run external commands. To do this, it spawns a shell, and uses it to run the provided command. (see https://fr.mathworks.com/help/matlab/ref/system.html)
This behavior is great for interactive use. However, for production code, it can cause issues with special characters as the shell will have a tendancy to over-interpret the given commands. So, for example, a directory with parenthesis in its name can cause shell errors and prevent the command from executing properly.
In the Python world, the subprocess module has a way to run commands directly, without spawning a shell (the "shell" argument):
Does Matlab have an equivalent? I know people have proposed various regular expressions to escape strings, but that is just not robust enough.

Best Answer

Maybe this works for you:
runtime = java.lang.Runtime.getRuntime();
process = runtime.exec('program arg1 arg2'); % non-blocking
% Continue Matlab processing in parallel to spawned process ...
% ...or:
rc = process.waitFor(); % block Matlab until external program ends
rc = process.exitValue(); % fetch an ended process' return code