<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Justyna, <div class=""><br class=""></div><div class="">I just scanned your code, but just to be sure: did you check your event type with fieldtrip?</div><div class=""><br class=""></div><div class="">For my EEG data e.g. the event type is ‚Stimulus‘.</div><div class="">You can check it with the following code</div><div class=""><pre class="code">cfg = [];
cfg.dataset            = 'yourfile.ext';
cfg.trialdef.eventtype = '?';
ft_definetrial(cfg);</pre><div class="">(<a href="http://www.fieldtriptoolbox.org/faq/how_can_i_find_out_what_eventvalues_and_eventtypes_there_are_in_my_data" class="">http://www.fieldtriptoolbox.org/faq/how_can_i_find_out_what_eventvalues_and_eventtypes_there_are_in_my_data</a>)</div><div class=""><br class=""></div><div class="">Best Anne</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div><blockquote type="cite" class=""><div class="">Am 15.02.2017 um 22:13 schrieb justyna marie <<a href="mailto:justyna_marie@yahoo.com" class="">justyna_marie@yahoo.com</a>>:</div><br class="Apple-interchange-newline"><div class=""><div class=""><div style="background-color: rgb(255, 255, 255); font-family: 'Helvetica Neue-Light', 'Helvetica Neue Light', 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;" class=""><div style="display: table; width: 1140px; box-sizing: border-box; outline: none 0px; padding: 0px 30px; font-family: "helvetica neue", "segoe ui", helvetica, arial, "lucida grande", sans-serif;" id="yui_3_16_0_ym19_1_1487182402574_30931" class=""><div style="display: table-cell; width: auto; word-wrap: break-word; word-break: break-word;" id="yui_3_16_0_ym19_1_1487182402574_30932" class=""><div id="yui_3_16_0_ym19_1_1487182402574_30933" class=""><div id="yui_3_16_0_ym19_1_1487182402574_30934" class=""><div style="font-family: "helvetica neue-light", "helvetica neue light", "helvetica neue", helvetica, arial, "lucida grande", sans-serif;" id="yui_3_16_0_ym19_1_1487182402574_30935" class=""><div style="color: rgb(34, 34, 34); font-size: small; font-family: arial, helvetica, sans-serif;" id="yui_3_16_0_ym19_1_1487182402574_30936" class="">Dear community members,</div><div style="color: rgb(34, 34, 34); font-size: small; font-family: arial, helvetica, sans-serif;" id="yui_3_16_0_ym19_1_1487182402574_30937" class=""><br id="yui_3_16_0_ym19_1_1487182402574_30938" class=""></div><div style="color: rgb(34, 34, 34); font-size: small; font-family: arial, helvetica, sans-serif;" id="yui_3_16_0_ym19_1_1487182402574_30939" class="">I am new to Fieldtrip therefore would very much appreciate your advice on the following:</div><div style="color: rgb(34, 34, 34); font-size: small; font-family: arial, helvetica, sans-serif;" id="yui_3_16_0_ym19_1_1487182402574_30940" class="">I have been trying to convert my pre-processed and segmented EEG data from eeglab .set format to Fieldtrip to perform some analyses. My data contains epochs marked by 5 types of trigger values ('3','4','5','6','7'). </div><div style="color: rgb(34, 34, 34); font-size: small; font-family: arial, helvetica, sans-serif;" id="yui_3_16_0_ym19_1_1487182402574_30941" class=""><br id="yui_3_16_0_ym19_1_1487182402574_30942" class=""></div><div style="color: rgb(34, 34, 34); font-size: small; font-family: arial, helvetica, sans-serif;" id="yui_3_16_0_ym19_1_1487182402574_30943" class="">I used:</div><div style="color: rgb(34, 34, 34); font-size: small; font-family: arial, helvetica, sans-serif;" id="yui_3_16_0_ym19_1_1487182402574_30944" class=""><br id="yui_3_16_0_ym19_1_1487182402574_30945" class=""></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small;" id="yui_3_16_0_ym19_1_1487182402574_30946" class=""><font face="arial, helvetica, sans-serif" id="yui_3_16_0_ym19_1_1487182402574_30947" class="">mydata = eeglab2fieldtrip (EEG, 'preprocessing');</font><br id="yui_3_16_0_ym19_1_1487182402574_30948" class=""></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small;" id="yui_3_16_0_ym19_1_1487182402574_30949" class=""><font face="arial, helvetica, sans-serif" id="yui_3_16_0_ym19_1_1487182402574_30950" class=""><br id="yui_3_16_0_ym19_1_1487182402574_30951" class=""></font></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small;" id="yui_3_16_0_ym19_1_1487182402574_30952" class=""><font face="arial, helvetica, sans-serif" id="yui_3_16_0_ym19_1_1487182402574_30953" class="">to convert between data formats and then build condition corresponding to my markers  with cfg.trialdef structure but unfortunately I keep getting the following message:</font></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small;" id="yui_3_16_0_ym19_1_1487182402574_30954" class=""><font face="arial, helvetica, sans-serif" id="yui_3_16_0_ym19_1_1487182402574_30955" class=""><div id="yui_3_16_0_ym19_1_1487182402574_30956" class=""><br id="yui_3_16_0_ym19_1_1487182402574_30957" class=""></div><div id="yui_3_16_0_ym19_1_1487182402574_30958" class=""><b id="yui_3_16_0_ym19_1_1487182402574_30959" class="">Error using ft_definetrial (line 188)</b></div><div id="yui_3_16_0_ym19_1_1487182402574_30960" class=""><b id="yui_3_16_0_ym19_1_1487182402574_30961" class="">no trials were defined, see FT_DEFINETRIAL for help</b></div><div id="yui_3_16_0_ym19_1_1487182402574_30962" class=""><br id="yui_3_16_0_ym19_1_1487182402574_30963" class=""></div><div id="yui_3_16_0_ym19_1_1487182402574_30964" class="">I then tried to define the trial structure with the following script:</div><div id="yui_3_16_0_ym19_1_1487182402574_30965" class=""><br id="yui_3_16_0_ym19_1_1487182402574_30966" class=""></div><div id="yui_3_16_0_ym19_1_1487182402574_30967" class=""><div id="yui_3_16_0_ym19_1_1487182402574_30968" class="">eventValues = {'3','4','5','6','7'};</div><div id="yui_3_16_0_ym19_1_1487182402574_30969" class="">prepost = [0.2 1.7];</div><div id="yui_3_16_0_ym19_1_1487182402574_30970" class="">ftype = 'eeglab_set';</div><div id="yui_3_16_0_ym19_1_1487182402574_30971" class="">data = struct;</div><div id="yui_3_16_0_ym19_1_1487182402574_30972" class="">for evVal = 1:length(eventValues)</div><div id="yui_3_16_0_ym19_1_1487182402574_30973" class="">    infile = fullfile(strcat('D:\Exp_8\EEG_<wbr id="yui_3_16_0_ym19_1_1487182402574_30974" class="">analyses\filename', [eventValues{evVal}],'.set'));</div><div id="yui_3_16_0_ym19_1_1487182402574_30975" class="">    cfg = [];</div><div id="yui_3_16_0_ym19_1_1487182402574_30976" class="">    cfg.dataset = infile;</div><div id="yui_3_16_0_ym19_1_1487182402574_30977" class="">    cfg.headerfile = infile;</div><div id="yui_3_16_0_ym19_1_1487182402574_30978" class="">    cfg.dataformat = ftype;</div><div id="yui_3_16_0_ym19_1_1487182402574_30979" class="">    cfg.headerformat = ftype;</div><div id="yui_3_16_0_ym19_1_1487182402574_30980" class="">   </div><div id="yui_3_16_0_ym19_1_1487182402574_30981" class="">    cfg.continuous = 'no';</div><div id="yui_3_16_0_ym19_1_1487182402574_30982" class="">    cfg.trialdef.prestim = prepost(1);</div><div id="yui_3_16_0_ym19_1_1487182402574_30983" class="">    cfg.trialdef.poststim = prepost(2);</div><div id="yui_3_16_0_ym19_1_1487182402574_30984" class="">    cfg.trialfun = 'ft_trialfun_general';</div><div id="yui_3_16_0_ym19_1_1487182402574_30985" class="">    cfg.trialdef.eventtype = 'Trigger';</div><div id="yui_3_16_0_ym19_1_1487182402574_30986" class="">    cfg.trialdef.eventvalue = eventValues{evVal};</div><div id="yui_3_16_0_ym19_1_1487182402574_30987" class="">    cfg = ft_definetrial(cfg);</div><div id="yui_3_16_0_ym19_1_1487182402574_30988" class="">    data.(eventValues{evVal}) = ft_preprocessing(cfg);</div><div id="yui_3_16_0_ym19_1_1487182402574_30989" class="">end</div><div id="yui_3_16_0_ym19_1_1487182402574_30990" class=""><br id="yui_3_16_0_ym19_1_1487182402574_30991" class=""></div><div id="yui_3_16_0_ym19_1_1487182402574_30992" class=""><br id="yui_3_16_0_ym19_1_1487182402574_30993" class=""></div><div id="yui_3_16_0_ym19_1_1487182402574_30994" class="">but I am getting exactly the same error...</div><div id="yui_3_16_0_ym19_1_1487182402574_30995" class=""><br id="yui_3_16_0_ym19_1_1487182402574_30996" class=""></div><div id="yui_3_16_0_ym19_1_1487182402574_30997" class="">Any suggestions of likely mistakes of my part/ problem with script would be most helpful.</div><div dir="ltr" id="yui_3_16_0_ym19_1_1487182402574_31000" class=""><br id="yui_3_16_0_ym19_1_1487182402574_31001" class=""></div><div dir="ltr" id="yui_3_16_0_ym19_1_1487182402574_31002" class="">Many thanks,</div><div dir="ltr" id="yui_3_16_0_ym19_1_1487182402574_31003" class=""><br id="yui_3_16_0_ym19_1_1487182402574_31004" class=""></div><div dir="ltr" id="yui_3_16_0_ym19_1_1487182402574_31005" class="">Justyna</div></div></font></div></div></div></div></div></div><div class=""></div><div id="yui_3_16_0_ym19_1_1487182402574_30844" class=""> </div><div class="signature" id="yui_3_16_0_ym19_1_1487182402574_30845"><br class=""></div></div></div>_______________________________________________<br class="">fieldtrip mailing list<br class=""><a href="mailto:fieldtrip@donders.ru.nl" class="">fieldtrip@donders.ru.nl</a><br class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</div></blockquote></div><br class=""></div></body></html>