MATLAB Answers

Export uitable's data to a spreadsheet Excel

61 views (last 30 days)
I have designed a GUI which has an uitable and a push button which, when is pressed, allows to export the uitable's data to an Excel spreadsheet. My problem is that I want to add the uitable's headers to the matrix Select which has the numeric values. This matrix is used by the pushbutton callback, as seen below:
htable = uitable(...);
SelecY = get(htable,'Data');
Callback of the pushbutton
function hExpExcelCallback(src,evt)
FileName = uiputfile('*.xls','Save as');

Accepted Answer

Fangjun Jiang
Fangjun Jiang on 9 Nov 2011
You need to do some processing in the case that the table data is all numerical, because the column header is returned in a cell array. The following example uses a uitable, but should apply to the table you have in your GUI as long as you have the handle.
Vito Marangelli
Vito Marangelli on 1 Jan 2015
I have the same problem and I would like to know if Excel for Mac can be used with the command xlswrite

Sign in to comment.

More Answers (0)


Community Treasure Hunt

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

Start Hunting!

Translated by