Last active
May 21, 2018 18:13
-
-
Save marks/0dcd77a5ef6bf0ecd7b431193ac04b00 to your computer and use it in GitHub Desktop.
octave
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -e | |
if command -v matlab >/dev/null 2>&1; then | |
if [ $# -gt 1 ]; then | |
# Remove ".m" script suffix if it exists, see http://www.mathworks.com/help/matlab/ref/matlablinux.html | |
COMMAND="${2%.m}" | |
matlab -nodisplay -nosplash -nodesktop -r "run $COMMAND; quit;" | |
else | |
echo "Error: Expecting argument 2 to contain the command to run in Matlab" | |
exit 1 | |
fi | |
else | |
octave "$@" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment