Differences

This shows you the differences between two versions of the page.

Link to this comparison view

mgl:taskreference [2013/08/02 07:01]
mgl:taskreference [2013/10/08 21:52]
Line 313: Line 313:
 If you want the second interval to be randomized over the interval 2-2.5 seconds in intervals of 0.1 seconds (i.e. you want it to be either 2,​2.1,​2.2,​2.3,​2.4 or 2.5: If you want the second interval to be randomized over the interval 2-2.5 seconds in intervals of 0.1 seconds (i.e. you want it to be either 2,​2.1,​2.2,​2.3,​2.4 or 2.5:
  
-  task.segmin = [1.3 2]; +  task.segmin = [1.3 nan]; 
-  task.segmax = [1.3 2.5]; +  task.segmax = [1.3 nan]; 
-  task.segquant ​= [0 0.1];+  task.segdur{2} = [2:​0.1:​2.5];​ 
 + 
 +Or, if you want different durations with different probabilities (the above would make each of the segment durations equally possible: 
 + 
 +  task.segmin = [1.3 nan]; 
 +  task.segmax = [1.3 nan]; 
 +  task.segdur{2} = [1 2 8]; 
 +  task.segprob{2} = [0.8 0.1 0.1]; 
 + 
 +This would make the second segment have durations of either 1 2 or 8 seconds with the 1 second one having a probability of 0.8 and the others having 0.1 probability. You can also specify multiple segments to have different durations like: 
 + 
 +  task.segmin = [1.3 nan nan]; 
 +  task.segmax = [1.3 nan nan]; 
 +  task.segdur{2} = [2:0.1:2.5]; 
 +  task.segdur{3} = [1 2 8]; 
 +  task.segprob{3} ​= [0.8 0.1 0.1]; 
 + 
 +This would make segment 2 and segment 3 behave as in the above two examples.
  
 You can also have a segment wait until a backtick happens, so that you can easily synch to volumes, for example: You can also have a segment wait until a backtick happens, so that you can easily synch to volumes, for example:
Line 323: Line 340:
   task.synchToVol = [0 1];   task.synchToVol = [0 1];
  
-This will cause the second segment to last a random amount of time between 2 and 2.5 seconds and then wait until a backtick occurs before going on to the next trial.+This will cause the second segment to last a random amount of time between 2 and 2.5 seconds and then wait until a backtick occurs before going on to the next trial. Note that when using synchToVol it is a good idea to make the segment for which you are waiting for a volume acquisition to happen slightly shorter than you actually want. This way the segment time will be finished and it will be waiting for the volume acquisition to continue
  
 ===== How to wait for user input before moving to next segment ===== ===== How to wait for user input before moving to next segment =====