Brush Data in GUI: Access in speparate function

7 visualizaciones (últimos 30 días)
Felix
Felix el 13 de Nov. de 2018
Editada: Felix el 13 de Nov. de 2018
Hey everyone! I am struggeling to access data using the brushing tool in an separate function. I have read various contributions here but I didn't find a solution which suits me. What a basically want to do is 1. Brush certain data in a figure 2. Call a speparate function and access the data 3. Doing some computation on it. To keep it simple I have created this small script where my main problem occurs:
close all
clear all
clc
% Small test script
haxes = axes;
hLine = plot(haxes,1:10,1:10);
hbrush = brush(gcf);
% Call separate function if the selection has been done
set(hbrush,'ActionPostCallback',{@BushAction,hLine},'enable','on')
When the data using the brush tool is selected, the function
function BushAction(varargin)
% doing some cool stuff...
end
should be called, after the selection has been done. Using this code and setting a breakpoint in the separate function, 2 problems occur:
  1. The brush tool is still active and the previous selected data is not used.
  2. Probably due to problem 1, there is no way to find the selected data.
Can anyone help me with this issue?
Thanks in advance!
Felix

Respuestas (0)

Categorías

Más información sobre Workspace Variables and MAT Files en Help Center y File Exchange.

Productos


Versión

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by