problem to run system(''.exe) on Mac
Show older comments
Hi to All I have recently migrate to MacosX 10.7.2 from windows and I use Matlab 2009b.
On my mac when I try to run a system command (equivalently bang or unix) appears the following error:
>system('myprogram.xe')
bin/bash/ myprogram.exe command not found.
Really I do not know how to strart to fix this problem any help suggestion is welcome.
erasmo
Accepted Answer
More Answers (3)
erasmo mancusi
on 28 Jan 2012
0 votes
1 Comment
Walter Roberson
on 28 Jan 2012
You might be having path problems. Try
!echo $PATH
and check to see whether the directory that has the program is listed in the PATH. If it is not then you will either need to adjust the shell path or name the directory explicitly.
erasmo mancusi
on 30 Jan 2012
Edited: Walter Roberson
on 9 Feb 2017
1 Comment
Javier de la Torre Costa
on 9 Feb 2017
Hi I am interested in this problem but I don't understand the solution you give, could you explain me more detailed pls?
Walter Roberson
on 10 Feb 2017
For Parallels on the Mac:
- first start a virtual machine
- now use one of the two methods described at http://osxdaily.com/2013/08/08/change-default-application-open-files-mac-os-x/ to indicate that you either want to open the particular .exe with Parallels Desktop or that you want to always open all .exe with Parallel Desktop. Note: you might have difficulty selecting "always open with" if the file resides on a Windows partition as it will probably say you do not have permission.
- Now, inside MATLAB, to run the executable, system() an 'open' command naming the .exe . You can pass it arguments using --args . For example,
system('open matlab.exe --args -r "disp('hello');quit"')
Instead of setting up parallels as the default application, you should be able to use open with the -a or -b options. More information on those flags is at http://brettterpstra.com/2014/08/06/shell-tricks-the-os-x-open-command/
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!