I am assuming that you would like to change the Editor/Debugger under preferences in MATLAB, so when you edit any file, it will be open in that editor. But on Linux machine, when you are setting this to gedit or any other editor, its not working.
The possible reason for this is that your LD_LIBRARY_PATH has the path to some other C/C++ shared libraries that wouldn't allow this.
As a workaround, you can set the external editor in LD_LIBRARY_PATH:
LD_LIBRARY_PATH = ; /usr/bin/gedit