In your previous thread, I gave you a link to a routine that find the brushed objects.
As hinted in the code referenced, for any one object that has been brushed, get() the Brushdata property; it will be a logical vector, where true indicates that the corresponding datapoint has been brushed. (Or so it appears to me.)
xd = get(Handle, 'XData');
yd = get(Handle, 'YData');
brush = get(Handle, 'BrushData');
brushed_x = xd(brush);
brushed_y = yd(brush);
Or if you prefer indices,
brushed_locs = find(get(Handle, 'BrushData'));
2 Comments
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/25597-how-can-i-save-the-brushed-data-to-a-variable#comment_56659
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/25597-how-can-i-save-the-brushed-data-to-a-variable#comment_56659
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/25597-how-can-i-save-the-brushed-data-to-a-variable#comment_653910
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/25597-how-can-i-save-the-brushed-data-to-a-variable#comment_653910
Sign in to comment.