Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Matlab excel interface
Replies: 5   Last Post: Mar 8, 2013 11:08 PM

 Messages: [ Previous | Next ]
 Shaun VanWeelden Posts: 15 Registered: 2/23/12
Re: Matlab excel interface
Posted: Mar 8, 2013 11:08 PM

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

Date Subject Author
3/2/13 james bejon
3/3/13 james bejon
3/8/13 ryanshuell@gmail.com
3/8/13 Shaun VanWeelden