[FieldTrip] ft_appenddata() and trials

anne Hauswald anne.hauswald at me.com
Thu Oct 20 09:30:25 CEST 2016


Hi Mona, 

the default setting in ft_databrowser for continuous data is to show blocksizes of 1 sec. Given your sampling rate, I guess the 0.998164 seconds is the closest time point to that. 
Then if, you have 15445 segments, each approx. 1 second long, you end up with more than 4 hours of data.
However, the data.time you end up with might not be continuous because the data.time you concatenate probably is not continuous but rather starts for each file at 0.

Hope this helps a bit
Anne


> Am 20.10.2016 um 00:44 schrieb Wong-Barnum, Mona <mona at sdsc.edu>:
> 
> 
> Hi Jan-Mathijs:
> 
> Yes, these should be continuous time recordings, just broken up and saved into separate files, each file represents about 20 minutes of recording so the end of one file should be the beginning of the next file.
> 
> I tried your suggestion but it seems the cat didn’t work.  Do you spot any problem with my steps:
> 
> >> addpath /path/to/fieldtrip
> >> ft_defaults
> >> data = importdata ( ‘appended.mat' )
> 
> data = 
> 
>       label: {389x1 cell}
>       trial: {1x14 cell}
>        time: {1x14 cell}
>     fsample: 603.1072
>         cfg: [1x1 struct]
> 
> >> whos
>   Name          Size                  Bytes  Class     Attributes
> 
>   data      1x1             29058186864  struct              
> 
> >> trial{1} = cat(2,data.trial{:});
> >> time{1} = cat(2,data.time{:});
> >> whos
>   Name          Size                  Bytes  Class     Attributes
> 
>   data          1x1             29058186864  struct              
>   time          1x1                74505712  cell                
>   trial         1x1             28982678512  cell
>                 
> >> data.trial = trial;
> >> data.time = time;
> >> data
> 
> data = 
> 
>       label: {389x1 cell}
>       trial: {[389x9313200 double]}
>        time: {[1x9313200 double]}
>     fsample: 603.1072
>         cfg: [1x1 struct]
> 
> >> save continous.mat data -v7.3
> 
> Then later, I used ft_databrowser() to view the data imported from the continuous.mat file and it says 15445 segments with time from 0 to 0.998164 seconds.  I’m not sure what it means by segment but the time should be over 4 hours.
> 
> Do you know what I’m doing wrong?
> 
> Mona
> 
> 
>> On Oct 19, 2016, at 1:33 PM, Schoffelen, J.M. (Jan Mathijs) <jan.schoffelen at donders.ru.nl <mailto:jan.schoffelen at donders.ru.nl>> wrote:
>> 
>> Hi Mona,
>> I wonder why you would want this. Is the time across the different files continuous, i.e. does the end of one file fit directly onto the next?
>> 
>> If so, but you really need to be sure about this, you can use the good old-fashioned cat command: trial{1} = cat(2,data.trial{:}); time{1} = cat(2,data.time{:});
>> data.trial = trial;data.time = time;
>> 
>> Best,
>> Jan-Mathijs
> 
> ************************************************
>     Mona Wong
>     Web & iPad Application Developer
>     San Diego Supercomputer Center
> 
>     You are the light you wish to see.
> ************************************************
> 
> 
> 
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20161020/dd160c92/attachment-0002.html>


More information about the fieldtrip mailing list