如何从用户输入的uitable中字符串化数据?
我正在尝试通过在 GUIDE 中创建一个 uitable 来构建矩阵形式。所以我希望用户将数据输入表中,并且我想在按钮上使用数据。但我不知道如何将数据从表串到按钮。有什么办法可以对表进行编程吗?我只接受回调。我是否必须在我的 m 编辑器中使用 create 函数、cellselectionfunc 等?
我想制作一个 3 x 3 矩阵,但无法在属性检查时编辑该行。当我删除第 4 行并应用时,它始终有 4 行。我只想制作 3 x 3 矩阵。不是 4 x 3。
I'm trying to build a matrix form by creating a uitable in GUIDE. So I want the user to enter data into the table and I want to use the data at the pushbutton. But I dunno how to string the data from the table to the pushbutton. Is there any way to program the table? Im just take callback only. Do I have to take the create function, cellselectionfunc and etc in my m-editor?
I want to make a 3 by 3 matrix, but I cannot edit the row at property inspection. When I delete the 4th row and I apply, its always has 4 rows. I just want to make 3 by 3 matrix. Not 4 by 3.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
假设您的 uitable 上的标记属性是 MyTable,以下代码将从表中获取数据。
如果您将此代码放入按钮回调中(假设您的按钮具有 MyButton 标签,这将是函数 MyButton_Callback(hObject, eventdata, handles)),您应该能够在单击按钮时看到表数据。
您可以将“OpeningFcn”图中的表格数据(应该由 Guide 创建)初始化为 3x3 单元矩阵。
Assuming the tag property on your uitable is MyTable the following code will get the data from the table.
If you put this code into your button callback (assuming your button has a tag of MyButton this will be function MyButton_Callback(hObject, eventdata, handles)) you should be able to see the table data when the button is clicked.
You can initialise the table data in the figures 'OpeningFcn' (which should have been created by Guide) to a 3x3 cell matrix.