Save brushed data to variable on button push
问题 I'm trying to save brushed data to a variable on button click. I've read other questions but can't find the method to do it. Inside a script the following code works: t=0:0.2:25; x=sin(t); n=plot(t,x,'s'); brush on pause brushedData = find(get(n,'BrushData')); However, calling the function selectBrush does not work: function selectBrush() % Create data t=0:0.2:25; x=sin(t); % Create figure with points fig=figure(); n=plot(t,x,'s'); brush on; addBP = uicontrol(1,'Style', 'pushbutton',...