필터 지우기
필터 지우기

External shell scripts in compiled GUI

조회 수: 2 (최근 30일)
Micah
Micah 2011년 10월 11일
I have a set of GUIs that call external shell scripts. I am calling them using unix(./script.sh) or system(./script.sh). I have to use shell scripts because I want to use a lot of awk commands and then pass those arguements to external java programs. This all works perfectly in MATLAB, but when I compile teh GUI, none of the scripts can run. I am including the scripts in the build file, but they do not seem to work. Any advice? Has anyone done this and can walk me through a simple example?
Thanks, Micah
  댓글 수: 3
Walter Roberson
Walter Roberson 2011년 10월 11일
One of the things to check would be your PATH environment variable: the GUI might be using a quite different PATH than your MATLAB session would have.
Micah
Micah 2011년 10월 11일
I can see that the .app 'thinks' it is in just / (root) when I add unix('pwd') to the code, but I am unwilling to force end users to add all these shell scripts to their root directories. Any advice? I thought that by adding those scripts to the batch, it would automatically include them in the path, but that seems to be untrue.

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

채택된 답변

Micah
Micah 2011년 10월 18일
I figured it out - for future reference, the best sequence of steps seems to be: Use file paths that are NOT relative to installation directory First, compile ONLY the .m files (not the .sh or .jar that will have to be called) The, when packaging, just package the .sh and .jar, keeping their directories in the same position relative to the .m (so select the entire directories to package, not each individual .sh or .jar).

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB Compiler에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by