Drexel dragonThe Math ForumDonate to the Math Forum

Search All of the Math Forum:

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

Math Forum » Discussions » Software » comp.soft-sys.matlab

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

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
james bejon

Posts: 219
Registered: 3/13/10
Re: Matlab excel interface
Posted: Mar 3, 2013 11:00 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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} )


Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2015. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.