Appdesigner: Edit Variable in Cache menu

3 views (last 30 days)
I on 25 Mar 2021
Edited: Vimal Rathod on 19 May 2021
% 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.

Answers (1)

Vimal Rathod
Vimal Rathod on 19 May 2021
Edited: Vimal Rathod on 19 May 2021
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


Find more on Data Import from MATLAB in Help Center and File Exchange




Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!