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
  • 647
  • 2
  • 8
  • 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,661
  • 1
  • 24
  • 47
0

You can also try:

matlab -r -nodesktop -nojvm 'dbEval(arg1 arg2 ...)'
smttsp
  • 3,651
  • 3
  • 32
  • 59