Pass a variable number of bash command line arguments to a MATLAB function
问题 Arguments that are passed to a bash script can be passed on to a MATLAB function in the following way: #!/bin/bash matlab -nodesktop -nosplash -nodisplay -r "my_function('$1','$2')" But how to do this if I do not know the number of arguments to pass a priori? So I want to do something like this: #!/bin/bash matlab -nodesktop -nosplash -nodisplay -r "my_function('$1',...,'$N')" where I do not know what number N equals to a priori. I figure that you could create a string with a for loop