Quite often you need to call external or system commands inside MatLab. Sometimes that external commands requires setting up environment variables in the shell. If would be a pain to do the environment setup inside MatLab. The easiest way I know of to solve the problem is actually launching matlab from the shell, instead of double clicking the MatLab icon.
See also: