How to read data in app.UITable?
23 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I want to read csv data to the app.UITable that I created in my GUI app. But when I pressed the button that reads the CSV file, the data is read in a table generated from a new window, rather than the UITable in the GUI window.
How can I fix this?
function BrowseforExcelfileButtonPushed(app, event)
t = readtable('Calibration243A.csv');
vars = {'Tone','Unit','Value'};
t = t(1:11,vars);
%Create a table UI component, and specify t as the data.
fig = uifigure;
uit = uitable(fig,'Data',t);
end
0 comentarios
Respuestas (1)
Dave B
el 4 de Nov. de 2021
Editada: Dave B
el 4 de Nov. de 2021
Instead of creating a new figure (with the uifigure function) and a new uitable (with the uitable function), just set the Data property on your existing app.UITable (I'm assuming you already have a property in your app called UITable, but if that's not what it's called use whatever name)
app.UITable.Data = t;
0 comentarios
Ver también
Categorías
Más información sobre Develop Apps Using App Designer en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!