Xlswrite and copy&paste uitable column names

1 Ansicht (letzte 30 Tage)
as hz
as hz am 17 Feb. 2013
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

Akzeptierte Antwort

Jan
Jan am 17 Feb. 2013
Copy&Paste duplicates the marked contents, but the headers are not selected. Therefore I'd suggest am extra button or adding a context menu on the Java level. From there you can apply a method similar to Azzi's suggestion considering if the Data are stored as cell or double matrix.

Weitere Antworten (1)

Azzi Abdelmalek
Azzi Abdelmalek am 17 Feb. 2013
Bearbeitet: Azzi Abdelmalek am 17 Feb. 2013
col=get(t,'columnname')' % t is the handle of your table
data=get(t,'data')
num=[col;data]
xlswrite('file.xls',num)
  5 Kommentare
Azzi Abdelmalek
Azzi Abdelmalek am 17 Feb. 2013
You can delete your file before saving again.
delete([pathname filename])
as hz
as hz am 17 Feb. 2013
Thanks.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Workspace Variables and MAT-Files 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!

Translated by