Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: get struct field including empty values
Replies: 12   Last Post: May 13, 2013 9:59 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
John

Posts: 6
Registered: 5/10/13
Re: get struct field including empty values
Posted: May 11, 2013 8:38 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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.



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.