Borrar filtros
Borrar filtros

How to save variable from GUI to workspace as a struct array

2 visualizaciones (últimos 30 días)
Tuan-Tu
Tuan-Tu el 7 de Feb. de 2015
Respondida: Geoff Hayes el 8 de Feb. de 2015
Hi guys, i've got a problem over here. I've create a GUI with one edit text and one push button .
My objective is that if i type a number in the edit text box and press the push button, I wanna store the number that I've just type in into a variable name: data in the MATLAB workspace as a struct array such as el.mes.tau1 I want the variable b can be store so that i can call it in the orthers functions.
I've done several research that requires me to use the global variable or assigin. But assigin doesn't work with struct array. For the global variable, Thus i need to type global b first before i can execute my command from the GUI itself. I wanna it to be automatically without me declare the global variable first. Anyone can help me ??

Respuestas (1)

Geoff Hayes
Geoff Hayes el 8 de Feb. de 2015
Tuan-Tu - why not just save the data to a mat file which can be accessible by the other functions outside of the GUI? You could just overwrite the mat file with the updated structure whenever the user presses the button on the GUI. See the save function for details.

Categorías

Más información sobre Structures en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by