Xlswrite and copy&paste uitable column names
Afficher commentaires plus anciens
Hi,
I have a uitable which I copy&paste and export. It does not paste the uitable column names to Excel. How can I do it?. Do I have to change something in the property inspector?
In addition, how do I also export also the uitable column names when I am saving the uitable data (using xlswrite).
Thanks
Réponse acceptée
Plus de réponses (1)
Azzi Abdelmalek
le 17 Fév 2013
Modifié(e) : Azzi Abdelmalek
le 17 Fév 2013
col=get(t,'columnname')' % t is the handle of your table
data=get(t,'data')
num=[col;data]
xlswrite('file.xls',num)
5 commentaires
Jan
le 17 Fév 2013
This works, when the uitable's data are a cell. But it can be a double matrix also.
Azzi Abdelmalek
le 17 Fév 2013
Yes. In this case
num=[col;num2cell(data)]
as hz
le 17 Fév 2013
Azzi Abdelmalek
le 17 Fév 2013
You can delete your file before saving again.
delete([pathname filename])
as hz
le 17 Fév 2013
Catégories
En savoir plus sur Spreadsheets dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!