Convert a matrix in the workspace into Excel in GUI
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I have a matrix A of size(n*m) in the workspace. I would like to develop a GUI which has a push button. So whenever I click on it, the matrix A which is present in the workspace convert it into Excel file. So that I can save it easily as Excel file.
Could you please suggest me the code for this?
0 Kommentare
Akzeptierte Antwort
Fangjun Jiang
am 19 Okt. 2011
You just need to run xlswrite. For example,
xlswrite('test.xls',rand(3,4))
Inside your push button callback, you might need to run this:
xlswrite('test.xls',evalin('base','MatrixA')) where 'MatrixA' is your variable name.
2 Kommentare
Fangjun Jiang
am 19 Okt. 2011
That can be done too. The function who() or whos() can give you a list of variables and their properties. Once you have that list, you can put the list in a ListBox or Popup Menu. Then you can let the user to select the variable name. Once you get the variable name, then the above xlswrite() line can get the job done. Start from here to see some GUI examples.
http://www.mathworks.com/help/techdoc/creating_guis/exampleindex.html
Weitere Antworten (1)
Sean de Wolski
am 19 Okt. 2011
Well I would recommend looking at:
guide
to develop your GUI, and xlswrite to develop your excel export.
Siehe auch
Kategorien
Mehr zu Data Export to MATLAB 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!