Borrar filtros
Borrar filtros

Run function with input variable from linux terminal

4 visualizaciones (últimos 30 días)
Erik
Erik el 21 de Sept. de 2011
Comentada: Suganth Kannan el 7 de Ag. de 2016
I would like to run a function from the linux terminal. The function has an input variable of type string. How do I run this specific function with the input variable and how do I add the correct path for the function? The function is a main function and will in turn run other functions. Thank you in advance!!

Respuestas (1)

Grzegorz Knor
Grzegorz Knor el 21 de Sept. de 2011
Simple example:
matlab -nosplash -nodesktop -r "ezplot('x')"
To run function 'function_name' in 'you directory' type in terminal:
matlab -nodesktop -nosplash -r "cd('your directory');function_name('your string')"
  2 comentarios
Erik
Erik el 21 de Sept. de 2011
Thank you!
Suganth Kannan
Suganth Kannan el 7 de Ag. de 2016
@Erik I highly recommend that you add the -nojvm modifier in front of the -r, so MATLAB will start without starting the Java Virtual Machine, too.

Iniciar sesión para comentar.

Categorías

Más información sobre Startup and Shutdown 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!

Translated by