- add a callback to the button
- In the callback, retrieve the Value property of the edit field
- Use the retrieved value to indicate the file in your loading function.
How to take input from Edit Text Field and load the data with Push Button
25 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
hello,
I want to create a guide interface where the user enters the file name .xlsx or .csv in a text field and load the data from the table by clicking on a button.
Thanks
0 comentarios
Respuestas (1)
Cris LaPierre
el 6 de Mzo. de 2021
Editada: Cris LaPierre
el 6 de Mzo. de 2021
If you are new to app designer, I suggest going through the tutorial. Once you are familiar with accessing properties of your components and using callbacks, the approach for your original question is
It could look something like this
% Button pushed function: LoadButton
function LoadButtonPushed(app, event)
fname = app.EditField.Value;
app.data = readmatrix(fname);
end
0 comentarios
Ver también
Categorías
Más información sobre Migrate GUIDE Apps 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!