I am trying to search a structure and extract the array numbers that contain data that match certain criteria. I am trying to search with the "find" function. The structure arrays are information of a finite element mesh and look like
Elements.Type = integer describing the element type (ie 1 = tetrahedron, 2 = cube, etc)
Elements.Nodes = integers describing the nodes that make up the element. the node x,y,z coordinates are in a separate structure.
Elements.E = double describing the modulus of elasticity
Elements.Nu = double describing the Poisson's ratio
Elements.bounds = doubles describing the bounding box of the element in question and is arranges like:
Elements(i).bounds =
[x_min,y_min,z_min;
x_max,y_max,z_max] for element i
I have an xy plane (I have the zcoordinate) and I want to find the elements that intersect the plane in question. The method is to find elements where z_min <= z and z_max >= z. My initial try at this looked like
elem_intersect = find(Elements.bounds(1,3) < z_coordinate & Elements.bounds(2,3) > z_coordinate);
What I was hoping to get was a list of the array numbers for the arrays in "Elements" that match the above criteria. So I could then do the rest of my analysis by stepping through
elem_intersect,
opening
Elements( elem_intersect(i) ).E
for modification.
I was hoping not to add the steps of converting the Elements.bounds field to a cell, then cell to matrix.
Is there a way to use the find function on structures like this?
Thanks for your help,
Seth
