Dear Afraim,
> Thanks for looking into this.
>
> > Try the following:
> >
> > data = rand(1, 100);
> > data = data + sin((1:100)*(2*pi/100));
> > data = data - mean(data);
> > K{1}.RT = 3;
> > K{1}.row = [1:length(data)];
> > K{1}.LChoice = 'Gaussian';
> > K{1}.LParam = 10;
> > K{1}.HChoice = 'none';
> > D = spm_filter('apply',K,data');
> > figure
> > plot(data);
> > hold on
> > plot(D, 'r');
>
> Unfortunately I get the following error:
>
> ??? Index exceeds matrix dimensions.
>
> Error in ==> /usr/local/SPM99/spm_filter.m
> On line 131 ==> y = Y(K{s}.row,:);
>
> Error in ==> /home/chilli/afraim/matlab/tester.m
> On line 14 ==> D = spm_filter('apply',K,data)
>
> > The main point is that K{1}.row contains indices to the data, not the
> > data itself.
>
> I do remember trying with K{1}.row = 1 but that didn't work
> either. As I said, I did manage to do the job with spm_make_filter
> but I'm curious to know why I can't get this particular function to
> work for me.
The reason why it does not seem to work for you is that spm_filter
operates on column data, i.e. you have to transpose your row column
vector 'data' to make it work (as suggested in my first email).
Good luck, Stefan
--
Stefan Kiebel
Functional Imaging Laboratory
Wellcome Dept. of Cognitive Neurology
12 Queen Square
WC1N 3BG London, UK
Tel.: +44-(0)20-7833-7478
FAX : -7813-1420
email: [log in to unmask]
|