How to brush the plot and then save the brushed data in GUI?

ε祈祈猫儿з 提交于 2019-12-02 01:00:01

Adding pause after brush on does the trick:

t=0:0.2:25; plot(t,sin(t),'.-');
brush on
pause
hBrushLine = findall(gca,'tag','Brushing');
brushedData = get(hBrushLine, {'Xdata','Ydata'});
brushedIdx = ~isnan(brushedData{1});
brushedXData = brushedData{1}(brushedIdx);
brushedYData = brushedData{2}(brushedIdx);
Shaun314

I actually just answered this this morning.

Check out my answer to this question, and keep my comments in mind to my answer as well, I may have made a mistake in my original solution.

saving user input from uitable matlab GUI?

Hopefully it can help you too!

To summarize, add a waitfor(gcf); output=varToSave (make sure varToSave isn't from a handle/object about to be deleted) where output is the output returned from your GUI function.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!