From 81becef1d713c9dbb6571c2810515f11c664d709 Mon Sep 17 00:00:00 2001 From: Aaron Matthew Simmons Date: Wed, 21 Apr 2021 15:59:42 -0700 Subject: [PATCH] chanloc fix fixed channel location preservation in erplab bin operations function --- erplab_default_values.m | 4 ++-- functions/erpchanoperator.m | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/erplab_default_values.m b/erplab_default_values.m index 30b5cf05..00153e22 100755 --- a/erplab_default_values.m +++ b/erplab_default_values.m @@ -1,5 +1,5 @@ -erplabver = '8.14'; % current erplab version -erplabrel = '15-Apr-2021'; % DOB +erplabver = '8.15'; % current erplab version +erplabrel = '21-Apr-2021'; % DOB %ColorB = [170 180 195]/255; % old background color (until version 3) %ColorB = [0.9216 0.8353 0.6078]; % background color for version 4 %ColorB = [0.7020 0.7647 0.8392]; % background color since version 4.0.0.3 diff --git a/functions/erpchanoperator.m b/functions/erpchanoperator.m index 3fb77252..2b17f14e 100755 --- a/functions/erpchanoperator.m +++ b/functions/erpchanoperator.m @@ -68,6 +68,7 @@ keeplocs = 0; end + % % Delete chans? % @@ -81,6 +82,11 @@ chdelop = regexprep(chdelop,',',' '); rewroteop = ['ERPout = delerpchan(ERPin, [' chdelop '])']; eval([rewroteop ';']) + + if keeplocs == 1 + + ERPout = chanlocs_matcher(ERPout,ERPin); + end return end @@ -105,7 +111,12 @@ exclchanstr = vect2colon(exclchan); rewroteop = ['ERPout = chreref(ERPin, ''' formref ''',' exclchanstr ' )']; end - eval([rewroteop ';']) + eval([rewroteop ';']); + + if keeplocs == 1 + + ERPout = chanlocs_matcher(ERPout,ERPin); + end return end % add a dot for .*, ./ and .^ operations @@ -388,4 +399,6 @@ ERPout = chanlocs_matcher(ERPout,ERPin); end + +end