how to get the data from edit box of GUI and use in other .m file
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
madhu T S
am 8 Mai 2015
Bearbeitet: Stephen23
am 18 Mai 2015
Hello ppl... I want to know that how to use the data or value in the edit box of the GUI and I want to use the same data in some other .m file.. please let me know asap
thanks and regards madhu
0 Kommentare
Akzeptierte Antwort
Image Analyst
am 8 Mai 2015
Use get():
myVar = get(handleToEditBox, 'String');
Then you can save it to a mat file with save
save(matFullFileName, 'myVar');
that the other m-file can read in with load(matFullFileName).
0 Kommentare
Weitere Antworten (1)
CAM
am 8 Mai 2015
To supplement the above answer:
Add str2num if it is a value, so you get the correct datatype.
myVar = str2num(get(handleToEditBox, 'String'));
If the file already exists, add the "-append" switch to the save statement
save(matFullFileName, 'myVar', '-append')
Hope that helps.
2 Kommentare
Siehe auch
Kategorien
Mehr zu Migrate GUIDE Apps finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!