Dear Bill,
> My apologies I changed the bins to 32 and this made no difference either. I
> read your mails more carefully this time and used the debugging mode. I
> found that the problem becomes apparent at about line 368 in
> spm_get_ons.m (see *** below) where the variable 'on' is up to this line
> reported as:
>
> Name Size Bytes Class
> on 1x1 1532 cell array
>
> on =
> [1X180 double]
>
> after processing line 368 suddenly becomes
>
> Name Size Bytes Class
> on 179x1 1432 double array
>
> not sure why this occurs as I am still on the vertical part of the matlab
> learning curve...could it be the format in which I enter the onsets vector?
> ( I use 'load' to load the file onsets.txt in 8 digit ascii format and
> enter this variable name when prompted for the onsets).
>
> Name Size Bytes Class
>
> onsets 1x180 1440 double array
>
> Thanks very much for any advice you can provide.
Have a look at the lines after line 279:
% create stick functions
%-----------------------------------------------
for j = 1:length(on)
ons = sparse(k*T,1);
for p = 1:length(on{j})
q = round(on{j}(p)*T + 1);
ons(q:(q + dur{j}(p))) = 1;
end
sf{i} = ons(1:(k*T));
i = i + 1;
end
end
end
Here, your onsets are converted to the stickfunctions 'sf'. It must be
here that you 'lose' one of your onsets. Please check with your
debugger, why this happens. My strong guess is that during the
round-operation and writing to 'ons', you find that one of your onsets
gets removed. Could you verify and identify this onset? Most likely, two
of your onsets specify (for some reason) the same times or are very
close together in time. What you could do to find out what onset this
is, is to insert something along these lines:
(I didn't check this code, but something like that:)
for p = 1:length(on{j})
q = round(on{j}(p)*T + 1);
if ons(q) > 0
warning(sprintf('Onset %d (%.2f scans) duplicates stick function',
p,on{j}(p)))
else
ons(q:(q + dur{j}(p))) = 1;
end
end
The solution would then be to remove this onset from your onset vector.
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]
|