<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>Thanks all, </p>
<p>The problem is fixed:</p>
<p><br>
</p>
<p>Here is the answer :</p>
<p></p>
<div>cfg = [];</div>
<div>cfg.demean = 'yes'; % base correction</div>
<div>data.trial{1,1} = eeg.eeg_data;</div>
<div><br>
</div>
<div></div>
<div>data.time{1,1} = 1:size(eeg.eeg_data,2);</div>
<div>data.label{1,1} = 'chan 1';</div>
<div>data.label{2,1} =  'chan 2';</div>
<div>data.label{3,1} = 'chan 3';</div>
<div>data.label{4,1} =  'chan 4';</div>
<div>data.label{5,1} = 'chan 5';</div>
<div>data.label{6,1} =  'chan 6';</div>
<div>data.label{7,1} = 'chan 7';</div>
<div>data.label{8,1} =  'chan 8';</div>
<div>data.fsample = eeg.samp_rate;</div>
<div><br>
</div>
<div>[data1] = ft_preprocessing (cfg, data);</div>
<br>
<p></p>
_____
<div>Bahar<br>
<br>
<div style="color: rgb(0, 0, 0);">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> fieldtrip-bounces@science.ru.nl <fieldtrip-bounces@science.ru.nl> on behalf of Arjen Stolk <a.stolk8@gmail.com><br>
<b>Sent:</b> Thursday, August 11, 2016 4:25 PM<br>
<b>To:</b> FieldTrip discussion list<br>
<b>Subject:</b> Re: [FieldTrip] reading .mat in fieldtrip</font>
<div> </div>
</div>
<div>
<div dir="ltr">Bahareh, according to <a href="http://www.fieldtriptoolbox.org/reference/ft_redefinetrial" id="LPlnk699244">http://www.fieldtriptoolbox.org/reference/ft_redefinetrial</a> (or 'help ft_redefinetrial') cfg.trl should be
<div id="LPBorder_GT_14709514158340.44001962063807265" style="margin-bottom: 20px; overflow: auto; width: 100%; text-indent: 0px;">
<table id="LPContainer_14709514158310.17367832456941157" cellspacing="0" style="width: 90%; position: relative; overflow: auto; padding-top: 20px; padding-bottom: 20px; margin-top: 20px; border-top-width: 1px; border-top-style: dotted; border-top-color: rgb(200, 200, 200); border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(200, 200, 200); background-color: rgb(255, 255, 255);">
<tbody>
<tr valign="top" style="border-spacing: 0px;">
<td id="ImageCell_14709514158320.025794695035040283" colspan="1" style="width: 250px; position: relative; display: table-cell; padding-right: 20px;">
<div id="LPImageContainer_14709514158320.5971472576351144" style="height: 150px; position: relative; margin: auto; display: table; width: 150px; background-color: rgb(255, 255, 255);">
<a id="LPImageAnchor_14709514158320.741424309577398" href="http://www.fieldtriptoolbox.org/reference/ft_redefinetrial" target="_blank" style="display: table-cell; text-align: center;"><img aria-label="Preview image with link selected. Double-tap to open the link." id="LPThumbnailImageID_14709514158320.7620497502255899" width="150" height="150" style="display: inline-block; max-width: 250px; max-height: 250px; height: 150px; width: 150px; border-width: 0px; vertical-align: bottom;" src="http://www.fieldtriptoolbox.org/_media/logo-share.png"></a></div>
</td>
<td id="TextCell_14709514158330.8164047879071183" colspan="2" style="vertical-align: top; position: relative; padding: 0px; display: table-cell;">
<div id="LPRemovePreviewContainer_14709514158330.4347479789739961"></div>
<div id="LPTitle_14709514158330.1689055350775155" style="top: 0px; color: rgb(0, 120, 215); font-weight: normal; font-size: 21px; font-family: wf_segoe-ui_light, "Segoe UI Light", "Segoe WP Light", "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; line-height: 21px;">
<a id="LPUrlAnchor_14709514158330.11381186857681991" href="http://www.fieldtriptoolbox.org/reference/ft_redefinetrial" target="_blank" style="text-decoration: none;">reference:ft_redefinetrial – FieldTrip</a></div>
<div id="LPMetadata_14709514158330.059983805220100495" style="margin: 10px 0px 16px; color: rgb(102, 102, 102); font-weight: normal; font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: 14px; line-height: 14px;">
www.fieldtriptoolbox.org</div>
<div id="LPDescription_14709514158330.3570504704895763" style="display: block; color: rgb(102, 102, 102); font-weight: normal; font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: 14px; line-height: 20px; max-height: 100px; overflow: hidden;">
Note that this reference documentation is identical to the help that is displayed in MATLAB when you type “help ft_redefinetrial”. FT_REDEFINETRIAL allows you to ...</div>
</td>
</tr>
</tbody>
</table>
</div>
<br>
<div style="margin-bottom: 20px; overflow: auto; width: 100%; text-indent: 0px;">
<table cellspacing="0" style="width: 90%; position: relative; overflow: auto; padding-top: 20px; padding-bottom: 20px; margin-top: 20px; border-top-width: 1px; border-top-style: dotted; border-top-color: rgb(200, 200, 200); border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(200, 200, 200); background-color: rgb(255, 255, 255);">
<tbody>
<tr valign="top" style="border-spacing: 0px;">
<td colspan="1" style="width: 250px; position: relative; display: table-cell; padding-right: 20px;">
<div style="height: 150px; position: relative; margin: auto; display: table; width: 150px; background-color: rgb(255, 255, 255);">
<a href="http://www.fieldtriptoolbox.org/reference/ft_redefinetrial" style="display: table-cell; text-align: center;"><img style="display: inline-block; max-width: 250px; max-height: 250px; height: 150px; width: 150px; border-width: 0px; vertical-align: bottom; -webkit-user-select: none;" width="150" height="150" src="http://www.fieldtriptoolbox.org/_media/logo-share.png"></a></div>
</td>
<td colspan="2" style="vertical-align: top; position: relative; padding: 0px; display: table-cell;">
<div><a class="ms-Icon--x ms-icon-font-size-14" style="font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-weight: normal; position: relative; cursor: pointer; padding: 8px; float: right; color: rgb(102, 102, 102); -webkit-user-select: none; margin-left: 10px; background-color: rgb(239, 246, 252);"></a></div>
<div style="top: 0px; color: rgb(0, 120, 215); font-weight: normal; font-size: 21px; font-family: wf_segoe-ui_light, "Segoe UI Light", "Segoe WP Light", "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; line-height: 21px;">
<a href="http://www.fieldtriptoolbox.org/reference/ft_redefinetrial" style="text-decoration: none;">reference:ft_redefinetrial – FieldTrip</a></div>
<div style="margin: 10px 0px 16px; color: rgb(102, 102, 102); font-weight: normal; font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: 14px; line-height: 14px;">
www.fieldtriptoolbox.org</div>
<div style="display: block; color: rgb(102, 102, 102); font-weight: normal; font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: 14px; line-height: 20px; max-height: 100px; overflow: hidden;">
Note that this reference documentation is identical to the help that is displayed in MATLAB when you type “help ft_redefinetrial”. FT_REDEFINETRIAL allows you to ...</div>
</td>
</tr>
</tbody>
</table>
</div>
<br>
<div><br>
</div>
<div>
<pre style="padding:0.5em; margin-top:0px; font-size:12px; border:1px dashed rgb(204,204,204); color:rgb(0,0,0); overflow:hidden; font-family:Consolas,'Andale Mono',Menlo,Monaco,monospace; background-color:rgb(247,249,250); white-space:pre-wrap; width:640px; text-align:justify">cfg.trl       = Nx3 matrix with the trial definition,</pre>
</div>
<div>For example, according to the page mentioned earlier (I suggest you actually read it this time: <a href="http://www.fieldtriptoolbox.org/faq/how_can_i_import_my_own_dataformat">http://www.fieldtriptoolbox.org/faq/how_can_i_import_my_own_dataformat</a>)</div>
<div><br>
</div>
<div>
<pre class="" style="padding:0.5em; margin-top:0px; font-size:12px; border:1px dashed rgb(204,204,204); color:rgb(0,0,0); overflow:hidden; font-family:Consolas,'Andale Mono',Menlo,Monaco,monospace; background-color:rgb(247,249,250); white-space:pre-wrap; width:640px; text-align:justify">cfg.trl = [1    100 -10;
           101  200 -10;
           201  300 -10];</pre>
</div>
<div><br>
</div>
<div>In contrast, you specified</div>
<div><span style="color:rgb(0,0,0); font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px">data.trial{1,1} = eeg.eeg_data;</span></div>
<div>
<div style="color:rgb(0,0,0); font-family:Calibri,Arial,Helvetica,sans-serif; font-size:16px">
cfg.trl = data.trial{1,1};</div>
</div>
<div><br>
</div>
<div>It's my guess that eeg.eeg_data is that <span style="color:rgb(0,0,0); font-family:Calibri,sans-serif; font-size:15px">8x10350000</span><span style="color:rgb(0,0,0); font-family:Calibri,sans-serif; font-size:15px"> matrix you imported, meaning your cfg.trl
 specification is off (it should be Nx3).</span></div>
<div><span style="color:rgb(0,0,0); font-family:Calibri,sans-serif; font-size:15px"><br>
</span></div>
<div><span style="color:rgb(0,0,0); font-family:Calibri,sans-serif; font-size:15px"><br>
</span></div>
<div class="gmail_extra"><br>
<div class="gmail_quote">2016-08-11 12:23 GMT-07:00 Bahareh Elahian (belahian) <span dir="ltr">
<<a href="mailto:belahian@memphis.edu">belahian@memphis.edu</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left-width:1px; border-left-color:rgb(204,204,204); border-left-style:solid; padding-left:1ex">
<div>
<div style="font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255); font-family:Calibri,Arial,Helvetica,sans-serif">
<p>I did something and it works but it is not correct .</p>
<p>I specified cfg.trl = data.trial{1,1}</p>
<p><br>
</p>
<p></p>
<div>cfg = [];</div>
<div>cfg.bpfilter = 'yes';</div>
<div>cfg.demean = 'yes';</div>
<div>data.trial{1,1} = eeg.eeg_data;</div>
<div>cfg.trl = data.trial{1,1};</div>
<div>data.time{1,1} = 1:size(eeg.eeg_data,2);</div>
<span class="">
<div>data.label{1,1} = 'chan 1';</div>
<div>data.label{2,1} =  'chan 2';</div>
</span>
<div>data.label{3,1} = 'chan 3';</div>
<div>data.label{4,1} =  'chan 4';</div>
<div>data.label{5,1} = 'chan 5';</div>
<div>data.label{6,1} =  'chan 6';</div>
<div>data.label{7,1} = 'chan 7';</div>
<span class="">
<div>data.label{8,1} =  'chan 8';</div>
</span>
<div>data.fsample = eeg.samp_rate;</div>
<div>newdata = ft_redefinetrial(cfg,data);</div>
<div><br>
</div>
<div>the newdata.time and newdata.trial are  <1*8 cell > . some of the cells are empty and one is NAN.</div>
<div><br>
</div>
<br>
<p></p>
</div>
<hr style="display:inline-block; width:98%">
<div dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b>
<a href="mailto:fieldtrip-bounces@science.ru.nl">fieldtrip-bounces@science.ru.<wbr>nl</a> <<a href="mailto:fieldtrip-bounces@science.ru.nl">fieldtrip-bounces@science.ru.<wbr>nl</a>> on behalf of Bahareh Elahian (belahian) <<a href="mailto:belahian@memphis.edu">belahian@memphis.edu</a>><br>
<b>Sent:</b> Thursday, August 11, 2016 2:00:52 PM
<div>
<div class="h5"><br>
<b>To:</b> FieldTrip discussion list<br>
<b>Subject:</b> Re: [FieldTrip] reading .mat in fieldtrip</div>
</div>
</font>
<div> </div>
</div>
<div>
<div class="h5">
<div>
<div style="font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255); font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Thanks but none of the options works.</p>
<p>The error is :</p>
<p><span>you should specify at least one configuration option.</span><br>
</p>
<p><span><br>
</span></p>
<p><span>Even <span>cfg.demean = 'yes'; is not enough.</span></span></p>
<p><span><span><br>
</span></span></p>
</div>
<hr style="display:inline-block; width:98%">
<div dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b>
<a href="mailto:fieldtrip-bounces@science.ru.nl">fieldtrip-bounces@science.ru.<wbr>nl</a> <<a href="mailto:fieldtrip-bounces@science.ru.nl">fieldtrip-bounces@science.ru.<wbr>nl</a>> on behalf of Antonio Rodriguez <<a href="mailto:toni.rbaena@gmail.com">toni.rbaena@gmail.com</a>><br>
<b>Sent:</b> Thursday, August 11, 2016 1:47:18 PM<br>
<b>To:</b> FieldTrip discussion list<br>
<b>Subject:</b> Re: [FieldTrip] reading .mat in fieldtrip</font>
<div> </div>
</div>
<div>
<p dir="ltr">Hi.</p>
<p dir="ltr">You can create an empty cfg structure, and fill with data :</p>
<p dir="ltr">cfg =[];<br>
newdata = ft_redefinetrial(cfg,data);</p>
<div class="gmail_extra"><br>
<div class="gmail_quote">El 11 ago. 2016 7:11 p. m., "Bahareh Elahian (belahian)" <<a href="mailto:belahian@memphis.edu">belahian@memphis.edu</a>> escribió:<br type="attribution">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left-width:1px; border-left-color:rgb(204,204,204); border-left-style:solid; padding-left:1ex">
<div dir="auto">
<div>
<div style="direction:ltr">Thanks for the answer,</div>
<div style="direction:ltr"> </div>
<div style="direction:ltr">I have had a look on this page before and I tried to follow the steps.</div>
<div style="direction:ltr">The problem is ;I do not have any cfg to define cfg.trl and use <span style="text-align:justify">newdata = ft_redefinetrial(cfg,data);</span></div>
<div style="direction:ltr"><span style="text-align:justify"><br>
</span></div>
<div style="text-align:justify; direction:ltr">Any other idea?</div>
<br>
<br>
</div>
<div><br>
On Aug 11, 2016, at 11:36 AM, Arjen Stolk <<a href="mailto:a.stolk8@gmail.com">a.stolk8@gmail.com</a>> wrote:<br>
<br>
</div>
<blockquote type="cite">
<div>
<div dir="ltr">Hi Bahareh,
<div><br>
</div>
<div>To get you started, see this page:</div>
<div><a href="http://www.fieldtriptoolbox.org/faq/how_can_i_import_my_own_dataformat">http://www.fieldtriptoolbox.or<wbr>g/faq/how_can_i_import_my_own_<wbr>dataformat</a><br>
</div>
<div><br>
</div>
<div>It describes what fieldtrip expects your raw data to look like.</div>
<div><br>
</div>
<div>Arjen</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">2016-08-11 8:42 GMT-07:00 Bahareh Elahian (belahian) <span dir="ltr">
<<a href="mailto:belahian@memphis.edu">belahian@memphis.edu</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left-width:1px; border-left-color:rgb(204,204,204); border-left-style:solid; padding-left:1ex">
<div lang="EN-US">
<div>
<p class="MsoNormal">Hi All,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I have a “.mat” file which contais: <span style="color:black; background-color:white">
<8x10350000 double> and sampling rate.<u></u><u></u></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="color:black; background-color:white">How should I import this data to field trip? By using  
</span><span style="font-size:10pt; font-family:'Courier New'; color:black">[data] = ft_preprocessing( cfg);</span><span style="font-size:12pt; font-family:'Courier New'"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black; background-color:white">  I am getting an error that the data should be in the format of raw or raw + comp. <u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black; background-color:white"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="color:black; background-color:white">Any idea?<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black; background-color:white"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="color:black; background-color:white">Thanks!<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black; background-color:white"><u></u> <u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
<br>
______________________________<wbr>_________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer">https://mailman.science.ru.nl/<wbr>mailman/listinfo/fieldtrip</a><br>
</blockquote>
</div>
<br>
</div>
</div>
</blockquote>
<blockquote type="cite">
<div><span>______________________________<wbr>_________________</span><br>
<span>fieldtrip mailing list</span><br>
<span><a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a></span><br>
<span><a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip">https://mailman.science.ru.nl/<wbr>mailman/listinfo/fieldtrip</a></span></div>
</blockquote>
</div>
<br>
______________________________<wbr>_________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer">https://mailman.science.ru.nl/<wbr>mailman/listinfo/fieldtrip</a><br>
</blockquote>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
______________________________<wbr>_________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer">https://mailman.science.ru.nl/<wbr>mailman/listinfo/fieldtrip</a><br>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>