<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" id="owaParaStyle">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">
<div id="body_question_328203" class="panel panel-default add_text_wrapping">
<div class="panel-body">How can I add events to epoched EEG data via matching variables?<br>
<br>
<p>My EEG Variable has the following structure for events:<br>
</p>
<br>
EEG.event: 1X157 struct (157 epochs of a EEG recording)
<p>    - EEG.event.type              --> specific number for each type of stimulus<br>
</p>
<p>    - EEG.event.accuracy        --> empty<br>
</p>
<p>    - ...</p>
<p>    - ...<br>
</p>
<p><br>
</p>
<p>I already read the event info into matlab. Its an array containing subject ID, Number of Stimulus and Accuracy for each trial --> trialdata 795x3<br>
</p>
<p><br>
</p>
<p>I want to add the accuracy data from this table (trialdata) to EEG.event.accuracy, but it has to be matched for the stimulus number that is in both the array "trialdata" and the variable EEG.event.type.</p>
<p><br>
</p>
<p>I was going for a loop with this basis:</p>
<p><br>
</p>
<p>for i = 1:size(VAR.event)</p>
<p>(VAR.event(i).type)</p>
<p>VAR.event(i).accuracy = trialdata....</p>
<p>end.</p>
<p><br>
</p>
<p>...and this is where i'm stuck. How can I tell the loop that I want the stimulus-matched accuracy read into it?</p>
<p><br>
</p>
<p>I tried it via the user interface first, but the problem seems to be that I don't do the matching via latencies...<br>
</p>
<p><br>
</p>
<p><br>
</p>
</div>
</div>
</div>
</body>
</html>