Epoch durations

Hi Francois

how can I get the duration of each epoch if I want to have the reaction times from my raw data?

Best
Shadi

Hi Shadi,
Can you give some more information about the context?
What is the measure you want to get: the distance between two markers? the length of a list of imported epoch?
How do you want to access this information?
Francois

Dear Francois

I want to get the distance between two markers which are sequentially. (I had a stimulus and a response after that and I want the time distances between these two). they have different codes but I dont know how to find the distances.

Thanks
Shadi

First make sure you have the same number of pairs stim/responses.
You can use the process “Events > Combine stim/response” for this, with the grouping: “A_AB, B_AB, A , B”

Then compute your response times manually:

  1. Right-click on the link to raw file > File > Export to Matlab > “link”
  2. Find the indices of the events:
iEvtA = find(strcmpi({link.F.events.label}, 'event_name_A'));
iEvtB = find(strcmpi({link.F.events.label}, 'event_name_B'));
  1. Compute the response time:
tA = link.F.events(iEvtA).times;
tB = link.F.events(iEvtB).times;
tresp = tB - tA;

Dear Francois

thank you but
unfortunately it’s not working.
the first part which is related to mark the events adds 2 more events to the event list which seems to be correct but
after writing the codes, I receive an answer= 1 2
and the event variable in link contains nothing. even when I check the raw file in Matlab directory.
it is a matris with 0*0 dimension.

Best
Shadi

but after writing the codes, I receive an answer= 1 2

What does this mean?
Please post screen captures to illustrate your problem.

and the event variable in link contains nothing

link.F.events

See reference documentation:
http://neuroimage.usc.edu/brainstorm/Tutorials/EventMarkers#On_the_hard_drive

the stimulus code is 101 and the response code is 1.

I attached two screenshots. the first one is my script and response and the second one is the variable “link”.

Best

Your code should be more something like:

iEvt101 = find(strcmpi({link.F.events.label}, '101'));
iEvt1 = find(strcmpi({link.F.events.label}, '1'));
t101 = link.F.events(iEvt101).times;
t1 = link.F.events(iEvt1).times;
tresp = t1 - t101

These are more general question about Matlab programming and are maybe off topic for this forum. You could try for instance to find someone around your lab who can help you with the Matlab part.

The variable “link” looks like what it should. Please see:
http://neuroimage.usc.edu/brainstorm/Tutorials/EventMarkers#On_the_hard_drive