Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:

Subject: Seth

From: Seth

Date: 29 Oct, 2008 00:01:04

Message: 1 of 1

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_max,y_max,z_max] for element i

I have an x-y plane (I have the z-coordinate) 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
        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,

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us