Appdesigner: Edit Variable in Cache menu
2 次查看(过去 30 天)
显示 更早的评论
% Button pushed function: EditButton
function EditButtonPushed(app, event)
t = readtable("Book1.xlsx","Sheet",2);
t.Thrust(1) = app.ValuesEditField.Value;
app.UITable.Data = t;
Here is part of my code and a quick intro:
I am building a GUI and am importing excel data in the above step and then editing the first row for my Thrust column. I have an edit field, numeric field, and button for the table.
Here is what I want to know:
Can I change my edit field to a drop down menu?
Can I edit any column from the interface without having to edit the variable in the code?
For example: I would like to use the cache menu to select weight, then type in a number and click the edit button to update the table, then perhaps use the cache menu again to select time and then type in the number of seconds.
0 个评论
回答(1 个)
Vimal Rathod
2021-5-19
编辑:Vimal Rathod
2021-5-19
Hello,
To answer your first question, you can change the edit field to a dropdown menu and put the options for the menu programmatically by scanning your table for the column names. Refer to this link for more information on creating a dropdown list.
You could edit any column from the interface by directly interacting with the table by creating a uitable for the data read from excel or by using indices to access the variable data and changing it at the specific row and column.
Refer to the following links to know more about editing values from the table and also creating an uitable
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Import from MATLAB 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!