Cleanup par4Gbl_Main8c.m

This commit is contained in:
2024-07-25 10:26:37 -04:00
parent 359b936b45
commit adf507476d
5 changed files with 176 additions and 268 deletions

View File

@@ -533,13 +533,19 @@ easy() {
'NoGrowth_.txt', and 'GrowthOnly_.txt' files will be generated in the 'PrintResults' folder.
EOF
script="EASYConsole.m"
script="$EASY_TEMPLATE_DIR/EASYConsole.m"
pushd "$EASY_TEMPLATE_DIR" || return 1
# Launch graphical matlab if the user wants
! ((YES)) && ask "Start EASY in MATLAB? This requires a GUI." &&
matlab -nosplash -sd ~/downloads -r "$script"
popd || return 1
# Add EASY directory to the Matlab path
# If this does not work we can try changing the -sd argument and if that fails then pushing/popping
debug "Adding EASY directory to the Matlab path"
hash matlab &>/dev/null &&
matlab -nodisplay -nosplash -nodesktop -nojvm -batch "addpath('$EASY_TEMPLATE_DIR')"
# Ask the user to launch EASYconsole.m in MATLAB
# MATLAB doesn't support passing args to scripts se we have to use ENV VARS instead
# These are proably already set in our scope but be explicit just in case
! ((YES)) && ask "Start EASY in MATLAB? This requires a GUI." &&
SCANS_DIR="$SCANS_DIR" matlab -nosplash -sd "$SCANS_DIR" -r "run $script"
# Use the function return code see if we succeeded
get_easy_results "$SCANS_DIR" || return 1