I tried bash deactivate_matlab.sh:
"Error: There is no display set. The deactivation process
requires that an X display be set." (again, this computer has no GUI/ display)
I guess my particular situation is not supported. I am proceeding with https://mathworks.com/matlabcentral/answers/99859-how-can-i-deactivate-matlab-on-a-machine-i-cannot-access and the deactivation agreement. Thank you.