I have the following simple example:
x=-4:0.1:4;y= x.^2-1;f=figure;h=plot( x, y );bO = brush(gcf);set(bO,'enable','on');data=logical(get(h,'brushdata'));disp(data)
If I run it all the data will be zero. If I run it until the set command, choose subsequently the data from the plot and then continue with executing the other two commands the selected data will be displayed.
How can I control with the callback to wait until I gather the data and then display them?
Best Answer