Can I "export", "write" or "save" a table to eg Excel ?

1 次查看(过去 30 天)
I want to write my table variable in eg .TXT file of a .XLSX . Can I do that ?

回答(2 个)

Azzi Abdelmalek
Azzi Abdelmalek 2013-9-29
Use xlswrite
doc xlswrite
oc xlsread
  2 个评论
Michaël
Michaël 2013-9-29
I've tried that ...
>> C = table(A,B)
C =
A B
_ _
1 4
2 5
3 6
>> xlswrite('test.xls',C) Error using xlswrite (line 166) Input data must be a numeric, cell, or logical array.

请先登录,再进行评论。


Image Analyst
Image Analyst 2013-9-29
You can use fprintf() if you want to write out a simple text file. See the help for an example. You can use xlswrite() as long as you aren't going to do it over and over again in a loop, which would be very slow. In that case use ActiveX (let me know if you want a demo).
  2 个评论
Michaël
Michaël 2013-9-29
I would like a demo, because with a TABLE-variable it doesn't work without conversion to eg. a dataset-variable or a cell-array

请先登录,再进行评论。

Community Treasure Hunt

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

Start Hunting!

Translated by