Error exporting data to Excel

1 次查看(过去 30 天)
Sunkensie
Sunkensie 2015-7-2
评论: Sunkensie 2015-7-2
I'm currently receiving this error when trying to export data using xlswrite:
"Error using xlswrite (line 219)
No appropriate method, property, or field workbooks
for class COM.Excel_Application."
I've tried various workarounds, such as disabling Excel add-ins ( as suggested here ), however nothing seems to helped me to get this hump. Restarting the program doesn't help, and the column of data is too long to Copy.
The code I'm currently using is thus:
">> filename = 'trend.xls'
>> load('theil_spring.mat')
>>A=theil(:,1)
>>xlswrite(filename,A)"
I would greatly appreciate any help with this matter. Apologies if this is a basic issue - I'm new to MatLab and I'm still having some teething pains.
  1 个评论
Sunkensie
Sunkensie 2015-7-2
I created a work-around to solve this. It turns out the amount of data was causing memories in MatLab. To solve this I used the following code to re-organise my data:
j=1;n=length(theil);k=2;
for i=1:(n/k)
X(:,i)=theil(j:j+(k-1),1);
j=j+2;
end
It was then a simple matter of copy & pasting it into Excel. Crude, but it worked.

请先登录,再进行评论。

回答(1 个)

mun1013
mun1013 2015-7-2
It should be filename = 'trend.xls'
  3 个评论
mun1013
mun1013 2015-7-2
is there something you missed out in this function? xlswrite(filename, A , 'Sheet1' ,'A1:Z1');
Sunkensie
Sunkensie 2015-7-2
I've checked the associated documentation, and I don't need to specify a page or range. It's a single data column of 1865346 cells, specified as a cell array, which I want to export. I did specify the range in the function ('A1:A1865346')in case it helped. Either way the error persists.

请先登录,再进行评论。

Community Treasure Hunt

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

Start Hunting!

Translated by