[FieldTrip] ft_appenddata() and trials

Wong-Barnum, Mona mona at sdsc.edu
Thu Oct 20 00:44:35 CEST 2016

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?


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;


    Mona Wong
    Web & iPad Application Developer
    San Diego Supercomputer Center

    You are the light you wish to see.

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

More information about the fieldtrip mailing list