John
Posts:
6
Registered:
5/10/13
|
|
Re: get struct field including empty values
Posted:
May 11, 2013 8:38 AM
|
|
dpb <none@non.net> wrote in message <kmjn0s$hkl$1@speranza.aioe.org>... > On 5/10/2013 3:47 PM, dpb wrote: > ... > > > allData(allData.correct==1).FieldName > > Or, of course, if you make the field 'correct' a logical instead of > numeric then you can dispense w/ the '==1' part and simply write > > allData(allData.correct).FieldName > > -- >
Hey guys thanks for your responses.
allData(allData.correct==1) does not work because allData.correct returns every value as a unique anser, the solution to this is allData([allData.correct==1]) but this raises the same problem as stated in my first post.
The reason I allow empty values is in this case to differentiate between correct responses, incorrect responses, and no responses.
In fact, I wrote a function which returns indices of trials with specific paramaters the function works like: indices = findTrial(allData,'correct',1,'reactionTime','>300','block',{'A','B','C'}) returns the indices of the correct trials with a reactionTime > 300 conducted in block A, B or C.
Sinces I want this function to be applicable as best as possible, I don't care for empty or missing values untill a condition is set. So it is ok if there are missed trials (maybe we do want to look at other measurements and we are indifferent to the response) unless, we only want correct, or incorrect trials, in that case, we will leave the empty trials out.
A solution would be to check for empty values of all the fields specified in the function findTrial, since once such a field is given, a condition is set, and we therefore do not allow empty fields. So my problem would also be solved if there is a way of obtaining al empty values of a field.
|
|