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

3 views (last 30 days)
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 ??

Answers (1)

Geoff Hayes
Geoff Hayes on 8 Feb 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.

Categories

Find more on Structures 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!