The databrowser crashes and destroys the whole matlab session, how can I resolve this?

FieldTrip relies on MATLABs plotting routines, which uses specific renderers. Unfortunately, specific combinations of graphics card, operating system and MATLAB version can cause MATLAB to crash using specific renderer. This can happen when using the databrowser, and if this happens for you, it will always happen unless you change something. The easiest change can be made to the renderer, as it entails only a simple MATLAB command. In most FieldTrip functions, you can set the renderer via the cfg. As such, for the databrowser you can simply add

cfg.renderer = 'painters' 

prior to the call to ft_databrowser.

This error and solution has been confirmed by the Mathworks. Thanks to Martine van Schouwenburg for contacting Mathworks and forwarding their response.


“I have a feeling that the crash might be because of the renderer being chosen by MATLAB to plot the surface plot.

MATLAB has three renderers- OpenGL, Painters and Z-Buffer. Each of these renderers has its own merits and limitations. MATLAB chooses the correct renderer based on the type of figure that you are plotting.

Here is a documentation page that talks more about the three renderers in MATLAB:

Of the three renderers OpenGL has the ability to use the graphics hardware on your system to help render the graphics. This can occasionally cause incompatibilities due to the many different graphics cards out there and also the many different driver versions that exist for each of these cards.

So, you can try and switch to the software implementation of OpenGL by executing the following command in the command window:

opengl software

This setting is retained for the current session of MATLAB. If you want MATLAB to remember this setting across settings, then I would suggest that you add this command to your “startup.m”.

Please use the above command and then run your code to see if the crash still occurs.

IF THE ABOVE PROCEDURE DOES NOT WORK: We can try and change the renderer to one of the other two and see if this helps. You can change the renderer by using the “set” command:






Here “gcf” refers to the currently active figure window.

I would suggest that you try changing the renderer just before the “surf” command is executed and see if the crash stops happening when using a particular renderer.”

faq/the_databrowser_crashes_and_destroys_the_whole_matlab_session_how_can_i_resolve_this.txt · Last modified: 2015/12/01 12:27 by robert

You are here: startfaqthe_databrowser_crashes_and_destroys_the_whole_matlab_session_how_can_i_resolve_this
CC Attribution-Share Alike 3.0 Unported Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0
This DokuWiki features an Anymorphic Webdesign theme, customised by Eelke Spaak and Stephen Whitmarsh.
Mobile Analytics Website Security Test