I am attempting to use the following function in Matlab's eeglab toolkit to rename events, which meet certain criteria (i.e., their latency is between two numbers):
EEGfastrts = pop_selectevent( EEG, 'latency',’0 <= fastval’,'type',{'AnyResponse'},'renametype','FastRTs','deleteevents','off','deleteepochs','off','invertepochs','off');
However, when I input a variable (i.e., fastval), instead of an int value, this function does not work.
I was wondering if anyone might have suggestions/work-arounds for using this function for a value that is represented by a variable. My goal is to insert the function into a loop, which will alter the variable value with every iteration.
Thank you in advance for your thoughts and input.
From the docs it expects that the
'latency'
input is a char, so you need to create that using your variable. One option is to usesprintf()
e.g:Then use this in your function call...