MATLAB: Quit matlab from script without “Attempt to restart MATLAB? [y or n]”

quit exit shell command line -r prompt

Whenever I call matlab from a (Linux) shell with the -r option and try to quit matlab automatically, a prompt appears (see below) – how can I avoid that stupid prompt and just quit??
Example: matlab -nodisplay -nosplash -nodesktop -r "foo; quit;"
Result: Attempt to restart MATLAB? [y or n]>>
Thanks in advance!
/ Anders.

Best Answer

Thanks for your swift answers! It turns out, that the root of the problem is a mex file I call at the end of my script. The mex call does not throw any errors or warnings, but it makes a CUDA call that makes MATLAB understand the subsequent quit (or exit) as a crash. Looking at the crash report, I think it is a conflict with MATLAB's internal GPU backend.
Sorry for troubling you all with this :-)