I'm working on a medical robotics project that captures a series of images and then does some processing on them in MATLAB. Since a number of other things have to be done outside MATLAB, I'm using another language for the overall control, and using console commands to trigger other portions.
I have a single .m file with a single function that takes the filepath to the directory the images are in and does all the MATLAB processing. How can I call this from the command line? I've seen matlab -r "function(input)" discussed in some other answers here, but it doesn't work for me (I get a syntax error at the open paren). More specifically, I get: matlab: eval: line 1690: syntax error near unexpected token '('.
I've seen a few people saying this has to be done by calling a shell script (which I have no idea how to write), but a number of other people saying it's doable without that, can anyone clarify?
Additionally, assuming I've merely botched the matlab -r syntax, how does MATLAB know where to find the .m file? Does it need to be in whatever directory I'm running the command from?