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
plot(grains) p = ginput(1) id = findByLocation(grains,p); hold on, plot(grains(id).boundary,'linecolor','r','lineWidth',2), hold off