Execute a bash script from Matlab
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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
0 commentaires
Réponses (1)
Walter Roberson
le 4 Juin 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.
0 commentaires
Voir également
Catégories
En savoir plus sur File Operations dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!