Knut - suppose that you have a bash script written as follows
echo Number of arguments passed: $#
for var in "$@"
All the script does is accept a variable list of arguments and echoes each one to the console (or Command Window when run in MATLAB). Save the above to a file named myBashScript.sh and assign executable privileges to it (easiest way is to just run chmod 777 myBashScript.sh in a terminal or other window, in the directory that contains this file).
In MATLAB do the following
pathToScript = fullfile(pwd,'myBashScript.sh');
subject1 = 'bert';
subject2 = 'ernie';
cmdStr = [pathToScript ' ' subject1 ' ' subject2];
The output from this script, as shown in the MATLAB Command Window, would be
Number of arguments passed: 2