0

I Have a matlab script dbEval.m:

function dbEval()

....function implementation
....
end


 dbEval();%call this function.

I run this script on the shell with

matlab dbEval.m

Now if I want to pass a argument thru command line execute. How can I do it? and how do I retrieve the argument on my script and use it as argument of my dbEval function?

pwan
  • 687
  • 3
  • 9
  • 16
  • Possible duplicate of [Running a matlab program with arguments](http://stackoverflow.com/questions/8981168/running-a-matlab-program-with-arguments) – CaptainTrunky Mar 20 '17 at 05:34

2 Answers2

1

You can do like this:

matlab -r 'dbEval(argument1, ... ,argumentN)';

or

matlab -r 'try dbEval(argument1, ... ,argumentN); catch; end; quit'
fatihk
  • 7,789
  • 1
  • 26
  • 48
0

You can also try:

matlab -r -nodesktop -nojvm 'dbEval(arg1 arg2 ...)'
smttsp
  • 4,011
  • 3
  • 33
  • 62