I'm creating a Matlab code in windows 10, which in turns uses the Ubuntu environment (inside windows 10) to perform some calculations mixing Matlab and OpenFOAM. I summary, what I do is that I have a Matlab code, which at certain moment calls a shell script function inside my ubuntu environment and this function perform everything that I need on ubuntu. If I test that .sh file inside the ubuntu environment it works flawless, but when I call it from Matlab (on windows 10) it doesn't work. In Matlab my call is done like this: system('bash -c "******.sh"'); and I receive the following error /bin/bash: ******.sh: No such file or directory even if the file exists. Any clues?
Asked
Active
Viewed 533 times
-2
-
1Please add your code and errors so we can see what you're doing. Second: sounds like a permission error which MATLAB can't handle. – Adriaan Apr 20 '18 at 13:35
-
1Is the current directory of the Matlab process the same in which the file is placed? You might want to try the absolute path of the shell script to see whether that is the cause. – Hans-Martin Mosner Apr 20 '18 at 13:36
-
OpenFOAM has Windows version as well. Is there any particular reason not to use it? Might solve your problem? – Herpes Free Engineer Apr 20 '18 at 16:32
-
Any feedback, if possible? Otherwise, I kindly encourage you to delete the question. – Herpes Free Engineer Apr 21 '18 at 07:26
1 Answers
0
Sorry, I was out of the country, but yesterday I was able to solve the problem. The reason to use both software that way is that I need OpenFOAM to work in its native configuration. That said, it seems that my problem was due to the fact that windows allows you to install bash and Ubuntu at the same time, so when I asked to Matlab to perform a system('bash -c "******.sh"') it tried to use bash whilst I had everything installed on Ubuntu. So the solution was simply to delete bash of my Windows10 installation.

Pablo Alarcón
- 15
- 1