Is there a way to call MATLAB from a Linux command line that would use a command line data file as input?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Kathleen
el 16 de Sept. de 2014
Comentada: Titus Edelhofer
el 23 de Sept. de 2014
I'd like to automate a process by calling MATLAB from the Linux command line in such a way that the name of the input datafile is on the command line and I can eliminate the gui to locate the input file from my M-code.
Simplistically, I'm looking for a command that would look something like this: matlab my-m-code.m my-input-data-file.csv
0 comentarios
Respuesta aceptada
Sreeram Mohan
el 19 de Sept. de 2014
Try
./matlab -r "yourScript" and things should work as you expected !
Some examples method 1: ./matlab -nodesktop -nosplash -r disp('sreeram') method 2: ./matlab -automation -r disp('sreeram')
hope this helps
--sreeram mohan
2 comentarios
Titus Edelhofer
el 23 de Sept. de 2014
You are nearly there:
matlab -r myMatlabFunction('myinputdatafile.csv');quit
You only need to make sure that MATLAB "finds" myMatlabFunction.m either on the path, or by something like
matlab -r cd('/home/kathleen/myfolder');myMatlabFunction('myinputdatafile.csv');quit
Titus
Más respuestas (0)
Ver también
Categorías
Más información sobre Get Started with MATLAB en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!