如何保存和清除输入 MATLAB GUI 的数据?
例如,假设我想设计一个带有用户输入数据的表的 GUI。然后我想要有 2 个按钮:一个用于保存表中当前的数据,另一个用于清除表中的数据。是否有任何代码示例/教程可以一般性地解释我如何以这种方式完成保存/修改 GUI 中 uicontrols 的状态?
For example, let's say I would like to design a GUI with a table that the user enters data into. I then want to have 2 push buttons: one that will save the data currently in the table, and another that will clear the data from the table. Are there any code examples/tutorials that explain in general how I can accomplish saving/modifying the state of uicontrols in a GUI in this way?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
MathWorks 的 Doug Hull 有一个很好的视频教程,显示 如何保存和恢复 GUI 的状态。
您还应该查看 41 个完整的 GUI 示例(特别是
GUI_41.m
)来自 Matt Fig < a href="http://www.mathworks.com/matlabcentral/fileexchange/" rel="nofollow">MathWorks 文件交换。从这些示例中应该很容易弄清楚如何清除 GUI 中的所有数据。
Doug Hull from the MathWorks has a nice video tutorial showing how to save and restore the state of a GUI.
You should also check out 41 Complete GUI Examples (specifically
GUI_41.m
) from Matt Fig on the MathWorks File Exchange.It should be straight-forward to figure out from those examples how to also clear all the data from your GUI.