write data from gui in excel
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Andrea Gil
am 26 Jul. 2011
Beantwortet: Jack Griffin
am 27 Mai 2015
Hi! Does anybody know how can a variable calculated on matlab GUI and stored in the handles be written on an already existing excel file?`
Or in other words, does the function xlswrite work at GUI? and if not, which function should be used instead?
Thanks a lot!
0 Kommentare
Akzeptierte Antwort
Fangjun Jiang
am 27 Jul. 2011
The format for range is 'a2:c4' as an example. For a single cell, you need to specify it as 'd4:d4' for example.
The range for 4th column and i+1 row would be
[dec2base27(4),num2str(i+1),':'dec2base27(4),num2str(i+1)]
The function dec2base27() is to convert 1 to 'A', 4 to 'D', 28 to 'AB' etc. It is to facilitate the xlswrite() function. You probably don't have it. I took it from xlswrite.m. Open xlswrite.m and you can find the dec2base27() function. Make it separate so you can use it anywhere else.
Weitere Antworten (4)
Chirag Gupta
am 26 Jul. 2011
xlswrite will work from a GUI.
xlswrite(filename,handles.data)
0 Kommentare
Fangjun Jiang
am 26 Jul. 2011
Yes, xlswrite() works anywhere. You need to pay attention in the code where you have the xlswrite() line that you have access to the data, and it's better to specify the full path of the Excel file.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Spreadsheets finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!