Execute a bash script from Matlab

조회 수: 1 (최근 30일)
Matthew
Matthew 2012년 6월 4일
Hi, thanks in advance for the guidance.....
Running Matlab 2011b on Win 7 machine.
I want to execute a bash script within Matlab. I know from Cygwin, etc I can call it like this: ./ecs_dir.sh folder_1 folder_2
And from a search of the Matlab archives, I found the following guidance on executing bash scripts: "! sh scriptname.sh" (see: http://www.mathworks.com/matlabcentral/newsreader/view_thread/293334)
But when I try this, i am given an error message: 'sh' is not recognized as an internal or external command, operable program or batch file.
How do I properly call this?
Thanks, Matt

답변 (1개)

Walter Roberson
Walter Roberson 2012년 6월 4일
The information about !sh is only for Unix systems.
Unless you start MATLAB from within Cygwin, etc., your command like would have to look something similar to
!cygwin.exe ecs_dir.sh folder_1 folder_2
I could be wrong on the details, as I have not used cygwin for a number of years.
Windows 7 does not have its own bash.

카테고리

Help CenterFile Exchange에서 File Operations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by