findByLocation edit page

select a grain by spatial coordinates

Syntax

id = findByLocation( grains, pos )

Input

grains grain2d
xy list of [x(:) y(:)] coordinates, respectively [x(:) y(:) z(:)]

Output

grains list of grainIds

Example

plotx2east
plot(grains)
p = ginput(1)
id = findByLocation(grains,p);
hold on, plot(grains(id).boundary,'linecolor','r','lineWidth',2), hold off

See also

EBSD.findByLocation grain2d.findByOrientation