フィルターのクリア

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

2 ビュー (過去 30 日間)
Tuan-Tu
Tuan-Tu 2015 年 2 月 7 日
回答済み: Geoff Hayes 2015 年 2 月 8 日
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 ??

回答 (1 件)

Geoff Hayes
Geoff Hayes 2015 年 2 月 8 日
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.

カテゴリ

Help Center および File ExchangeStructures についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by