Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
Store permanently data taken from an edit text box of GUI
조회 수: 1 (최근 30일)
이전 댓글 표시
답변 (1개)
Mischa Kim
2014년 2월 7일
댓글 수: 2
Mischa Kim
2014년 2월 7일
To see how it works, download reloading_param.m and the corresponding .fig file, remove some of the semi-colons from the evalstr commands in the code you pasted above and run the .m file.
Now, in the GUI enter a string in the top edit box, e.g., 007. When you do that the string gets saved in the variable handles.mystructdata in the callback function edit1_Callback. Hitting the SAVE DATA button saves the variable in data and to a .mat file:
data = handles.mystructdata
save('testmatfile.mat','data');
Close and re-open the GUI and hit the RELOAD DATA button.
temp = load('testmatfile.mat');
data=temp.data;
All the data from the .mat file is transfered into data. In the following loop the individual variables are backed out, one by one, and entered back into the corresponding GUI objects (which are recognized by their unique tags), the edit boxes, via the evalstr commands.
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!