[FieldTrip] Problem reading trials into ft_rejectvisual

Matt Mollison matt.mollison at gmail.com
Sun Apr 8 21:17:31 CEST 2012


Dashiel,

You're using curly braces {} for trial indexing; this creates a cell array,
which you don't want. Try using brackets [] to form a vector:
cfg.trials = [1,2,3,4,5,6,7,8,9,10,46];

Check out http://www.mathworks.com/help/techdoc/ref/specialcharacters.htmlfor
more matlab character syntax.

Matt

--
Univ. of Colorado at Boulder
Dept. of Psychology and Neuroscience
matthew.mollison at colorado.edu
http://psych.colorado.edu/~mollison/

On Sun, Apr 8, 2012 at 12:56 PM, Dashiel Munding
<dashiel.munding at gmail.com>wrote:

> Thought an example of the error message I'm getting might be useful in
> diagnosing the problem. I would delve further but I'm not an
> experienced MATLAB user, so I don't think my investigation would be
> very fruitful!
>
> ---
>
> Error using subsindex
> Function 'subsindex' is not defined for values of class 'cell'.
>
> Error in selfromraw (line 11)
>  data.trial  = data.trial(selrpt);
>
> Error in ft_selectdata_old (line 544)
>    data = selfromraw(data, 'rpt', selrpt);
>
> Error in ft_selectdata (line 45)
>  [varargout{1:nargout}] = ft_selectdata_old(varargin{:});
>
> Error in ft_rejectvisual (line 196)
>  data = ft_selectdata(data, 'rpt', cfg.trials);
>
> On 8 April 2012 20:52, Dashiel Munding <dashiel.munding at gmail.com> wrote:
> > Hello all,
> >
> > I'm trying to figure out a way of reading only selected trials into
> > analysis without running through ft_rejectvisual every time. I have a
> > list of trials that I have already rejected, and the documentation
> > (http://fieldtrip.fcdonders.nl/reference/ft_rejectvisual) says that I
> > should be able to use cfg.trials as a 1xN vector to put in a list of
> > those trials that I want to use :
> >
> > cfg.trials      = 'all' or a selection given as a 1xN vector (default =
> 'all')
> >
> > I've tried various formats for this vector (I'm new to both MATLAB and
> > fieldtrip, so this might be a simple solve) but I can't get a positive
> > result. I know I can save out the variable and read it in again at a
> > later date, but this seems like a very inefficient way of doing it if
> > all I need is a list of numbers, instead of a 1.5gb .m file...
> >
> > Has anyone come across/solved this problem? Can anyone provide me with
> > an example of the syntax fieldtrip is expecting?
> >
> > I've tried:
> >
> > cfg.trials = {'all' '-56', '-151', '-232', '-53'};
> >
> > cfg.trials = {'1','2','3','4','5','6','7','8','9','10','46'};
> >
> > cfg.trials = {1,2,3,4,5,6,7,8,9,10,46};
> >
> > and some other efforts to no avail!
> >
> > Thanks in advance, and sorry for naivety!
> >
> > Dashiel
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20120408/4e4fd2b0/attachment-0002.html>


More information about the fieldtrip mailing list