The Math Forum

Search All of the Math Forum:

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

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

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

Advanced Search

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

Posts: 221
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]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.