<html><head></head><body><div style="color:#000; background-color:#fff; font-family:Helvetica Neue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, Sans-Serif;font-size:13px"><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"><div style="display: table-cell; width: auto; word-wrap: break-word; word-break: break-word;" id="yui_3_16_0_ym19_1_1487182402574_30932"><div id="yui_3_16_0_ym19_1_1487182402574_30933"><div id="yui_3_16_0_ym19_1_1487182402574_30934"><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"><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">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"><br id="yui_3_16_0_ym19_1_1487182402574_30938"></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">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">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"><br id="yui_3_16_0_ym19_1_1487182402574_30942"></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">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"><br id="yui_3_16_0_ym19_1_1487182402574_30945"></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"><font face="arial, helvetica, sans-serif" id="yui_3_16_0_ym19_1_1487182402574_30947">mydata = eeglab2fieldtrip (EEG, 'preprocessing');</font><br id="yui_3_16_0_ym19_1_1487182402574_30948"></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"><font face="arial, helvetica, sans-serif" id="yui_3_16_0_ym19_1_1487182402574_30950"><br id="yui_3_16_0_ym19_1_1487182402574_30951"></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"><font face="arial, helvetica, sans-serif" id="yui_3_16_0_ym19_1_1487182402574_30953">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"><font face="arial, helvetica, sans-serif" id="yui_3_16_0_ym19_1_1487182402574_30955"><div id="yui_3_16_0_ym19_1_1487182402574_30956"><br id="yui_3_16_0_ym19_1_1487182402574_30957"></div><div id="yui_3_16_0_ym19_1_1487182402574_30958"><b id="yui_3_16_0_ym19_1_1487182402574_30959">Error using ft_definetrial (line 188)</b></div><div id="yui_3_16_0_ym19_1_1487182402574_30960"><b id="yui_3_16_0_ym19_1_1487182402574_30961">no trials were defined, see FT_DEFINETRIAL for help</b></div><div id="yui_3_16_0_ym19_1_1487182402574_30962"><br id="yui_3_16_0_ym19_1_1487182402574_30963"></div><div id="yui_3_16_0_ym19_1_1487182402574_30964">I then tried to define the trial structure with the following script:</div><div id="yui_3_16_0_ym19_1_1487182402574_30965"><br id="yui_3_16_0_ym19_1_1487182402574_30966"></div><div id="yui_3_16_0_ym19_1_1487182402574_30967"><div id="yui_3_16_0_ym19_1_1487182402574_30968">eventValues = {'3','4','5','6','7'};</div><div id="yui_3_16_0_ym19_1_1487182402574_30969">prepost = [0.2 1.7];</div><div id="yui_3_16_0_ym19_1_1487182402574_30970">ftype = 'eeglab_set';</div><div id="yui_3_16_0_ym19_1_1487182402574_30971">data = struct;</div><div id="yui_3_16_0_ym19_1_1487182402574_30972">for evVal = 1:length(eventValues)</div><div id="yui_3_16_0_ym19_1_1487182402574_30973">    infile = fullfile(strcat('D:\Exp_8\EEG_<wbr id="yui_3_16_0_ym19_1_1487182402574_30974">analyses\filename', [eventValues{evVal}],'.set'));</div><div id="yui_3_16_0_ym19_1_1487182402574_30975">    cfg = [];</div><div id="yui_3_16_0_ym19_1_1487182402574_30976">    cfg.dataset = infile;</div><div id="yui_3_16_0_ym19_1_1487182402574_30977">    cfg.headerfile = infile;</div><div id="yui_3_16_0_ym19_1_1487182402574_30978">    cfg.dataformat = ftype;</div><div id="yui_3_16_0_ym19_1_1487182402574_30979">    cfg.headerformat = ftype;</div><div id="yui_3_16_0_ym19_1_1487182402574_30980">   </div><div id="yui_3_16_0_ym19_1_1487182402574_30981">    cfg.continuous = 'no';</div><div id="yui_3_16_0_ym19_1_1487182402574_30982">    cfg.trialdef.prestim = prepost(1);</div><div id="yui_3_16_0_ym19_1_1487182402574_30983">    cfg.trialdef.poststim = prepost(2);</div><div id="yui_3_16_0_ym19_1_1487182402574_30984">    cfg.trialfun = 'ft_trialfun_general';</div><div id="yui_3_16_0_ym19_1_1487182402574_30985">    cfg.trialdef.eventtype = 'Trigger';</div><div id="yui_3_16_0_ym19_1_1487182402574_30986">    cfg.trialdef.eventvalue = eventValues{evVal};</div><div id="yui_3_16_0_ym19_1_1487182402574_30987">    cfg = ft_definetrial(cfg);</div><div id="yui_3_16_0_ym19_1_1487182402574_30988">    data.(eventValues{evVal}) = ft_preprocessing(cfg);</div><div id="yui_3_16_0_ym19_1_1487182402574_30989">end</div><div id="yui_3_16_0_ym19_1_1487182402574_30990"><br id="yui_3_16_0_ym19_1_1487182402574_30991"></div><div id="yui_3_16_0_ym19_1_1487182402574_30992"><br id="yui_3_16_0_ym19_1_1487182402574_30993"></div><div id="yui_3_16_0_ym19_1_1487182402574_30994">but I am getting exactly the same error...</div><div id="yui_3_16_0_ym19_1_1487182402574_30995"><br id="yui_3_16_0_ym19_1_1487182402574_30996"></div><div id="yui_3_16_0_ym19_1_1487182402574_30997">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"><br id="yui_3_16_0_ym19_1_1487182402574_31001"></div><div dir="ltr" id="yui_3_16_0_ym19_1_1487182402574_31002">Many thanks,</div><div dir="ltr" id="yui_3_16_0_ym19_1_1487182402574_31003"><br id="yui_3_16_0_ym19_1_1487182402574_31004"></div><div dir="ltr" id="yui_3_16_0_ym19_1_1487182402574_31005">Justyna</div></div></font></div></div></div></div></div></div><div></div><div id="yui_3_16_0_ym19_1_1487182402574_30844"> </div><div class="signature" id="yui_3_16_0_ym19_1_1487182402574_30845"><br></div></div></body></html>