MATLAB: Run matlab function with arguments on linux terminal

argumentslinuxshell

Hello, do you have any idea how to run matlab functions from the linux shell specifying their arguments? what i tried was: { matlab -r myfunction(argument1,argument2) } but it doesn't work oO

Best Answer

matlab -r 'myfunction(argument1,argument2)';
Or safer:
matlab -r 'try myfunction(argument1,argument2); catch; end; quit'