matlab brush,How to use the data brush tool to automatically save selected points in multiple line p...

MATLAB does not currently have the functionality to output multiple variables at once. The enhancement suggestion has been forwarded to the appropriate production team. It will be considered for inclusion in a future release of MATLAB. However, there are several options to work around this issue.

Option 1:

Use right-click -> Create Variable instead of going through the menu bar. Unfortunately this only saves a little time, as the user still has to create each variable individually.

Option 2:

Use a third party toolbox that can handle this.

However, MathWorks does not guarantee or warrant the use or content of these third-party submissions. Any questions, issues, or complaints should be directed to the contributing author.

Option 3:

Use the undocumented 'BrushData' property of a brush-able graphics object to see which data points are selected. Note that because it is undocumented, it may be removed in a future release of MATLAB. The 'BrushData' property is a "uint8" array of 0s and 1s, with 1s indicating data points that are selected. This must be transformed into logical array before it can be used to index into the data arrays.

See the attached "saveBrushDataScript.m" file for an example of the use of this property.

Unfortunately, this requires more interaction from the user, and probably means going back and forth from the figure and the command window to specify when the current selection is done. Variables will also have to be named programmatically, or through interaction in the the command window.

Option 4:

Similar to Option 3, use the 'BrushData' property in conjunction with the Data Brush tool's 'ActionPostCallback'. This will allow an action to be taken every time the Data Brush finishes a selection action (on the release of the mouse button). The callback can extract the 'BrushData' property from each line, and get the selected data by indexing into the 'XData' and 'YData' properties. The output happens in the background with no interaction from the user.

Unfortunately, this action will occur every time a selection is complete. The user may still be selecting more data points or removing them (using the Ctrl and Shift keys). The variables will also need to be named programmatically, and there may be issues with them overwriting variables that had already been saved.

See the attached "saveBrushDataCallback.m" file for an example of the use of this callback.

Some of the issues could be mitigated by using a dialog box, allowing the user to choose whether or not to save the selection, and also enter variable name(s) there.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值