Execute a bash script from Matlab

5 visualizzazioni (ultimi 30 giorni)
Matthew
Matthew il 4 Giu 2012
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

Risposte (1)

Walter Roberson
Walter Roberson il 4 Giu 2012
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.

Categorie

Scopri di più su File Operations in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by