How to export headers from uitable to excel sheet
    7 visualizzazioni (ultimi 30 giorni)
  
       Mostra commenti meno recenti
    
    Adam Taher
 il 15 Lug 2015
  
    
    
    
    
    Commentato: Adam Taher
 il 15 Lug 2015
            Hello, I have a uitable using GUI with 7 columns (number of rows doesn't matter) and I'm able to import data to xls extension with a pushbutton. But I realized that the 7 headers are not imported. Thanks for your help! Here is my code:
data = get(handles.uitable, 'data');
filename = 'something.xls';
xlswrite(filename,data);
0 Commenti
Risposta accettata
  Brendan Hamm
    
 il 15 Lug 2015
        Well the column names are stored in the 'ColumnName' of the uitable.
data = [get(handles.uitable,'ColumnName');get(handles.uitable, 'data')];
filename = 'something.xls';
xlswrite(filename,data);
4 Commenti
  Brendan Hamm
    
 il 15 Lug 2015
				It may be that your data is all numeric? If this is the case then you need to convert it to a cell array to concatenate:
[get(handles.uitable,'ColumnName')';num2cell(get(handles.uitable,'Data'))]
If not please provide more information.
Più risposte (0)
Vedere anche
Categorie
				Scopri di più su Develop Apps Using App Designer in Help Center e File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

