Back to the main page.

Bug 3452 - Wrong number of selected trials output in ft_redefinetrial

Status CLOSED FIXED
Reported 2018-09-13 11:09:00 +0200
Modified 2018-10-08 09:06:19 +0200
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Windows
Importance: P5 normal
Assigned to: Nir Ofir
URL:
Tags:
Depends on:
Blocks:
See also:

Nir Ofir - 2018-09-13 11:09:47 +0200

Hi, When using a logical vector for cfg.trials in ft_redefinetrial, the feedback written to the command window is wrong. Line 122 in ft_redefinetrial is: if fb, fprintf('selecting %d trials\n', length(cfg.trials)); end which would mean that it would output the length of the vector (the total number of trials), rather than the sum of the vector. I looked for "fprintf('selecting %d trials\n', length(cfg.trials))" in other .m files from FT (version 2018/09/12) to see if it happens elsewhere. I found 1 other function, ft_nonlinearassociation (starting line 92), but this function has a correction a line later for when logical cfg.trials is used. Thanks! Nir Ofir


Jan-Mathijs Schoffelen - 2018-09-24 20:31:06 +0200

Thanks for catching this, and please suggest a fix for the code through github, as a pull request. See the fieldtrip wiki (and search for 'git') if you are unsure what to do.


Nir Ofir - 2018-10-07 11:49:10 +0200

I suggested a fix and made a pull request in github.


Jan-Mathijs Schoffelen - 2018-10-08 09:06:10 +0200

.