MATLAB: Passing values to Bash script

linuxscript

Let's say I have a matlab file that calculates some values, giving:
alpha = 7
beta = 9
Now, I want to pass these values to a Bash script for use.
What is the syntax for doing this?

Best Answer

Example:
cmd = sprintf('alpha=%d beta=%d ls | head -$beta | tail -$alpha', alpha, beta);
system(cmd)