Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Matlab excel interface

Subject: Matlab excel interface

From: Akshara Soman

Date: 2 Mar, 2013 08:04:09

Message: 1 of 6

I'm trying to export a huge amount of data(5820 rows) from matlab to excel.
xlswrite can't handle this much amount of data. Its returned error code: 0x800A03EC.
Is there any alternative?

Subject: Matlab excel interface

From: james bejon

Date: 2 Mar, 2013 17:44:08

Message: 2 of 6

How many columns do you have?

Subject: Matlab excel interface

From: Akshara Soman

Date: 3 Mar, 2013 03:49:07

Message: 3 of 6

only 3 columns
evenif i limit the no. of rows to fewer than 100, xlswrite returns the same error.
i have to write more than 1000 characters to the same cell.writing fewer than 1000 characters to same cell works smooth with xlswrite.i have to write string of characters so cant use save,export etc.

Subject: Matlab excel interface

From: james bejon

Date: 3 Mar, 2013 16:00:08

Message: 4 of 6

Ah, you may have to do it the slow way then, i.e. opening an instance of Excel and writing to it one cell at a time. I don't have Excel (or Matlab) to hand, but something like this perhaps:

% Data
dat = repmat({char(64+ceil(rand(1,2000)*26))}, 10, 10);

% Excel handles
xlsApp = actxserver('Excel.Application');
xlsWbk = invoke(xls.Workbooks, 'Add');
xlsSht = invoke(xlsWbk.Worksheets, 'Item', 1);
xlsRng = invoke(xlsSht, 'Range', 'A1');

% Action
for i = 1:size(dat, 1)
for j = 1:size(dat, 2)

set( get(xlsRng, 'Offset', i-1, j-1), 'Value', dat{i, j} )

end
end

Subject: Matlab excel interface

From: Ryan

Date: 8 Mar, 2013 20:39:08

Message: 5 of 6

What the heck??? I find it hard to believe that you' can't write 100 rows of data to Excel from Matlab. Excel can handle a little over a million rows; Matlab can handle much more. You must be doing it wrong. Check out the samples here:
http://www.mathworks.com/help/matlab/ref/xlswrite.html

More samples here:
http://matlab.izmiran.ru/help/techdoc/ref/xlswrite.html

Finally, see these two examples:
http://www.mathworks.com/matlabcentral/fileexchange/2855-xlswrite/content/xlswrite.m
http://www.mathworks.com/matlabcentral/fileexchange/27236-improved-xlswrite-m/content/xlswrite.m


"james bejon" wrote in message <kgvs28$osu$1@newscl01ah.mathworks.com>...
> Ah, you may have to do it the slow way then, i.e. opening an instance of Excel and writing to it one cell at a time. I don't have Excel (or Matlab) to hand, but something like this perhaps:
>
> % Data
> dat = repmat({char(64+ceil(rand(1,2000)*26))}, 10, 10);
>
> % Excel handles
> xlsApp = actxserver('Excel.Application');
> xlsWbk = invoke(xls.Workbooks, 'Add');
> xlsSht = invoke(xlsWbk.Worksheets, 'Item', 1);
> xlsRng = invoke(xlsSht, 'Range', 'A1');
>
> % Action
> for i = 1:size(dat, 1)
> for j = 1:size(dat, 2)
>
> set( get(xlsRng, 'Offset', i-1, j-1), 'Value', dat{i, j} )
>
> end
> end

Subject: Matlab excel interface

From: Shaun VanWeelden

Date: 9 Mar, 2013 04:08:05

Message: 6 of 6

I absolutely agree with Ryan, I routinely write cell arrays from MATLAB to excel with over 150,000 elements in literally under 3 seconds. Should not be a problem if you are doing it right.

"Ryan" wrote in message <khdi9c$es5$1@newscl01ah.mathworks.com>...
> What the heck??? I find it hard to believe that you' can't write 100 rows of data to Excel from Matlab. Excel can handle a little over a million rows; Matlab can handle much more. You must be doing it wrong. Check out the samples here:
> http://www.mathworks.com/help/matlab/ref/xlswrite.html
>
> More samples here:
> http://matlab.izmiran.ru/help/techdoc/ref/xlswrite.html
>
> Finally, see these two examples:
> http://www.mathworks.com/matlabcentral/fileexchange/2855-xlswrite/content/xlswrite.m
> http://www.mathworks.com/matlabcentral/fileexchange/27236-improved-xlswrite-m/content/xlswrite.m
>
>
> "james bejon" wrote in message <kgvs28$osu$1@newscl01ah.mathworks.com>...
> > Ah, you may have to do it the slow way then, i.e. opening an instance of Excel and writing to it one cell at a time. I don't have Excel (or Matlab) to hand, but something like this perhaps:
> >
> > % Data
> > dat = repmat({char(64+ceil(rand(1,2000)*26))}, 10, 10);
> >
> > % Excel handles
> > xlsApp = actxserver('Excel.Application');
> > xlsWbk = invoke(xls.Workbooks, 'Add');
> > xlsSht = invoke(xlsWbk.Worksheets, 'Item', 1);
> > xlsRng = invoke(xlsSht, 'Range', 'A1');
> >
> > % Action
> > for i = 1:size(dat, 1)
> > for j = 1:size(dat, 2)
> >
> > set( get(xlsRng, 'Offset', i-1, j-1), 'Value', dat{i, j} )
> >
> > end
> > end

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us