Error exporting data to Excel

1 Ansicht (letzte 30 Tage)
Sunkensie
Sunkensie am 2 Jul. 2015
Kommentiert: Sunkensie am 2 Jul. 2015
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 Kommentar
Sunkensie
Sunkensie am 2 Jul. 2015
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.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

mun1013
mun1013 am 2 Jul. 2015
It should be filename = 'trend.xls'
  3 Kommentare
mun1013
mun1013 am 2 Jul. 2015
is there something you missed out in this function? xlswrite(filename, A , 'Sheet1' ,'A1:Z1');
Sunkensie
Sunkensie am 2 Jul. 2015
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.

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

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

Start Hunting!

Translated by