I don't know if I worded the question correctly, because I'm quite new to shell programming (If that's how it's called).
#!/bin/bash
cd /Applications/MATLAB_R2016b.app/bin
./matlab -nosplash -nodisplay -nodesktop
system('sleep 20')
cd /Users/WillyGuerrero/Documents/MATLAB/Examples/BodePlotOfDynamicSystemExample/
BodePlotOfDynamicSystemExample
system('sleep 20')
exit;
exit 0
Thats my entire shell script. First three lines, I open MATLAB in Terminal, once the instance is open I wait (without success) 20 seconds, i then move to the folder containing my ML script, open it, so some processing, hence the 20 seconds wait, exit the ML instance and then close the terminal Window.
Tha thing is my shell script won't run anything once the ML instance is open, and I'm out of ideas.
I tried googling my problem, but I'm pretty sure I can't get the wording right, therefore I ask you guys for help.
Thank you in advance.
P.S
I know the commands are not that wrong since I can open a Terminal window and write them by hand and the thing will run.