<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Hi Saini,
<div class=""><br class="">
</div>
<div class="">The error you get is caused by the fact that FieldTrip is not clairvoyant. Specifically, it is not able to figure out what the fileformat of your data is. You need to explicitly point to an existing file (with file extension) in cfg.dataset. I
 am not clairvoyant either, but given your specifications, my guess would be that you need to write something like: ‘C:\blabla\subject_1_MEG_data\4\c,rfDC’, assuming you are dealing with 4D neuroimaging data. If it’s another MEG data format your are using,
 you’d need to specify the appropriate filename for that system.</div>
<div class=""><br class="">
</div>
<div class="">Best wishes and good luck.<br class="">
<div><br class="">
</div>
<div>Jan-Mathijs</div>
<div><br class="">
</div>
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 22 Apr 2022, at 18:58, Shubhangi Saini via fieldtrip <<a href="mailto:fieldtrip@science.ru.nl" class="">fieldtrip@science.ru.nl</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">Hi 
<div class="">This is my code</div>
<div class="">
<div class="gmail-rtcContent" style="padding:30px">
<div class="gmail-lineNode" style="font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
</div>
<div class="gmail-lineNode" style="font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre" class="">cfg = [];</span></div>
<div class="gmail-lineNode" style="font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre" class="">cfg.dataset = <span style="color:rgb(167,9,245)" class="">
'C:\Users\hp\Documents\MATLAB\subject_1\MEG_data\4'</span>;</span></div>
<div class="gmail-lineNode" style="font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre" class="">data_meg = ft_preprocessing(cfg,MEG_data);</span></div>
<div class="gmail-lineNode" style="font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
</div>
<div class="gmail-lineNode" style="font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre" class=""><span style="color:rgb(14,0,255)" class="">for
</span>trialsel=1:10</span></div>
<div class="gmail-lineNode" style="font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre" class="">chansel = 1; <span style="color:rgb(0,128,19)" class="">
% this is the STIM channel that contains the trigger</span></span></div>
<div class="gmail-lineNode" style="font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre" class="">figure</span></div>
<div class="gmail-lineNode" style="font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre" class="">plot(data_meg.time{trialsel}, data_meg.trial{trialsel}(chansel, :))</span></div>
<div class="gmail-lineNode" style="font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre" class="">xlabel(<span style="color:rgb(167,9,245)" class="">'time (s)'</span>)</span></div>
<div class="gmail-lineNode" style="font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre" class="">ylabel(<span style="color:rgb(167,9,245)" class="">'channel amplitude (a.u.)'</span>)</span></div>
<div class="gmail-lineNode" style="font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre" class="">title(sprintf(<span style="color:rgb(167,9,245)" class="">'trial %d'</span>, trialsel));</span></div>
<div class="gmail-lineNode" style="font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre" class=""><span style="color:rgb(14,0,255)" class="">end</span></span></div>
<div class="gmail-lineNode" style="font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre" class=""><span style="color:rgb(14,0,255)" class=""><br class="">
</span></span></div>
<div class="gmail-lineNode" style="font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
<span style="white-space:pre" class=""><span style="color:rgb(14,0,255)" class="">And I am getting the following error please someone help me out.</span></span></div>
<div class="gmail-lineNode" style="font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace">
Error using ft_read_header<br class="">
unsupported header format "unknown"<br class="">
<br class="">
Error in ft_preprocessing (line 404)<br class="">
  hdr = ft_read_header(cfg.headerfile, headeropt{:});<span style="white-space:pre" class=""><span style="color:rgb(14,0,255)" class=""><br class="">
</span></span></div>
</div>
</div>
</div>
_______________________________________________<br class="">
fieldtrip mailing list<br class="">
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br class="">
https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!-ig0ZjvOaj67RHMp96oKOB7JZMLooOwDTjYidKl3f5IJbHsSahEos_kB_EnalThyu1vxTIZj7wTxVv4ix_3hL_VudGj1mCfYCT9ngw$
<br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>