Back to the main page.

Bug 995 - ft_topoplotCC should use strcmp instead of strmatch

Reported 2011-09-29 14:59:00 +0200
Modified 2011-10-05 15:08:36 +0200
Product: FieldTrip
Component: plotting
Version: unspecified
Hardware: PC
Operating System: Linux
Importance: P1 normal
Assigned to: Jan-Mathijs Schoffelen
Depends on:
See also:

Gio Piantoni - 2011-09-29 14:59:57 +0200

Created attachment 150 EEG layout I'm using ft_topoplotCC with some EEG data. line 187 of ft_topoplotCC uses strmatch begindx = strmatch(beglabel{i}, lay.label); However, if the label of the channels is 'E1' 'E2' ... 'E19' 'E20' 'E21', and beglabel{i} is 'E2', strmatch returns the indexex for 'E2' and also for 'E20' 'E21', because it looks for the beginning of the string in the cell of lay.label. You can either change it into begindx = strmatch(beglabel{i}, lay.label, 'exact'); or better begindx = strcmp(beglabel{i}, lay.label); because strmatch is deprecated. You can test it with the attached layout, with beglabel{i} = 'E2' Thanks!

Jan-Mathijs Schoffelen - 2011-10-03 14:02:06 +0200

Hi Gio, Thanks for noticing. I changed it into strcmp. Can you check whether it now works? Thanks, JM

Gio Piantoni - 2011-10-03 14:15:07 +0200

It works now, thanks for the quick fix!