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: find value in structure
Replies: 2   Last Post: Apr 3, 2013 7:29 AM

Advanced Search

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

Posts: 3
Registered: 11/28/11
find value in structure
Posted: Apr 3, 2013 4:28 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hey Yall,

I want to find a value within a structure, i know I can find it with a for loop but that seems to be insufficient. Example:

The structure is called tree with field c containing the coordinates of an edge and c varies in length depending on the length of the edge! Value is a double and the value to find.

I cant figure out, how to do this with structfun

structfun(@find, tree.c, value) or
structfun(@x, find(value == x), tree.c)
does not work

Anyone a solution for my problem?

Thanks in advance!

Stefan





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.