필터 지우기
필터 지우기

Run function with input variable from linux terminal

조회 수: 4 (최근 30일)
Erik
Erik 2011년 9월 21일
댓글: Suganth Kannan 2016년 8월 7일
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!!

답변 (1개)

Grzegorz Knor
Grzegorz Knor 2011년 9월 21일
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
Erik
Erik 2011년 9월 21일
Thank you!
Suganth Kannan
Suganth Kannan 2016년 8월 7일
@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.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by