Hi, folks! So, the Tips for the brush command state (I've spliced the following up a little to focus on ActionPostCallback but still include all the pertinent available info): "You can program the following callbacks for brush mode operations. ActionPostCallback < function_handle > — Function to execute after brushing Use this callback to execute code when a brush operation ends. The function handle should reference a function with two implicit arguments: function myfunction(obj,event_obj) % obj handle to the figure that has been clicked % event_obj object containing struct of event data The event data struct has the following field: AxesThe handle of the axes that is being brushed"
OK, so I do the following:
>> f = @(x,y) disp([x y]);
>> plot(1:10, 1:10)
>> bO = brush(1)
>> set(bO, 'ActionPostCallback', f, 'enable', 'on')
Color: [1 0 0]
Then, when I brush the plot, the figure disappears and back in the command window I get:
"Warning: An error occurred during the mode callback.
> In uitools.uimode.fireActionPostCallback at 14
In datamanager.brushup at 114
In hgfeval at 63
In uitools.uimode.modeWindowButtonUpFcn at 46
In uitools.uimode.modeControl>localModeWindowButtonUpFcn at 155"
and no display of either the figure's handle nor the axis' handle.
What am I missing?