I'm having trouble accessing all of the event labels that are stored in
the D object from my EEG data that have been loaded into an SPM file.
D.events shows that there are 1x1521 struct array with fields: type,
value, duration, time, offset.
However, when I attempt to access one element of this structure using:
"D.events(3)", for instance, I get the following error:
>> D.events(3)
??? Index exceeds matrix dimensions.
Error in ==> getfield at 46
f = f(index{:});
Error in ==> getset at 25
res{i} = getfield(this, parent, {ind(i)}, fieldname);
Error in ==> meeg.events at 11
res = getset(this, 'trials', 'events', varargin{:});
Error in ==> meeg.subsref at 28
varargout = {feval(subs(1).subs, this, subs(2).subs{:})};
If I type "D.events(1)" this gives the info below. I would have expected
specific information about event1???:
>> D.events
ans =
1x1521 struct array with fields:
type
value
duration
time
offset
I've loaded all of the data as continuous because I wanted to be sure to
preserve the trial order as I need to make changes to the event labels
based on their order. If I use "g = D.events" to load the events
structure into another variable then I can access them all normally
(unlike above). However, I then can't seem to be able to write the new
set of events to the D object. I tried "D.events = g;" but this gives
the following error:
>> D.events = g;
??? Error using ==> meeg.subsasgn at 19
meeg method names cannot be used for custom fields
Any help will be much appreciated.
Joe
Just FYI, using Matlab R2009b, SPM recently updated using the SVNupdate
ulility from the ICN.
|