Back to the main page.

Bug 3074 - Unable to plot component topography Matlab 2015b: "Error using surf X, Y, Z, cannot be complex"

Status CLOSED INVALID
Reported 2016-02-19 14:34:00 +0100
Modified 2019-08-10 12:32:48 +0200
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Windows
Importance: P5 normal
Assigned to:
URL:
Tags:
Depends on:
Blocks:
See also:

rinbl64 - 2016-02-19 14:34:19 +0100

OVERVIEW: Matlab 2015b returns the following warnings and errors when attempting to plot ICA topographies (MEG data) using ft_databrowser: Warning: Imaginary parts of complex X and/or Y arguments ignored > In ft_plot_vector (line 377) In ft_databrowser>redraw_cb (line 1780) In ft_databrowser (line 727 Error using surf (line 69) Error in ft_plot_topo (line 251) Error in ft_databrowser>redraw_cb (line 1926) Error in ft_databrowser (line 727) CODE TO REPRODUCE: cfg = []; cfg.viewmode = 'component'; cfg.layout = 'neuromag306mag.lay'; % specify the layout file that should be used for plotting cfg.dataset = 'exampelica.mat'; ft_databrowser(cfg) ACTUAL RESULTS: Warning: Imaginary parts of complex X and/or Y arguments ignored > In ft_plot_vector (line 377) In ft_databrowser>redraw_cb (line 1780) In ft_databrowser (line 727) Error using surf (line 69) X, Y, Z, and C cannot be complex. Error in ft_plot_topo (line 251) h = surf(Xi-deltax/2, Yi-deltay/2, zeros(size(Zi)), Zi, 'EdgeColor', 'none', 'FaceColor', shading); Error in ft_databrowser>redraw_cb (line 1926) ft_plot_topo(chanx, chany, chanz, 'mask', laychan.mask, 'interplim', 'mask', 'outline', laychan.outline, 'tag', 'topography', 'hpos', laytopo.pos(laysel,1)-laytopo.width(laysel)/2, 'vpos', laytopo.pos(laysel,2)-laytopo.height(laysel)/2, 'width', laytopo.width(laysel), 'height', laytopo.height(laysel), 'gridscale', 45); Error in ft_databrowser (line 727) redraw_cb(h); BUILD DATE & HARDWARE: fieldtrip-20160212 Windows 7 Enterprise EXAMPLE DATA: https://www.dropbox.com/s/2oj3eamd2iv13ba/0121_exampelica.mat?dl=0


Jan-Mathijs Schoffelen - 2016-02-20 12:58:54 +0100

This is a user error. Component topographies should not be complex-valued to begin with. This is an indication that something went wrong in ft_componentanalysis. Most likely cause is 'rank-deficient' data.


Robert Oostenveld - 2019-08-10 12:32:48 +0200

This closes a whole series of bugs that have been resolved (either FIXED/WONTFIX/INVALID) for quite some time. If you disagree, please file a new issue on https://github.com/fieldtrip/fieldtrip/issues.