Error exporting data to Excel

2 ビュー (過去 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.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by