Path: news.mathworks.com!not-for-mail
From: "Ilya Rozenfeld" <rozeni.nospam@alum.rpi.edu>
Newsgroups: comp.soft-sys.matlab
Subject: Re: More details -- actxserver('excel.application')
Date: Tue, 7 Jul 2009 13:24:01 +0000 (UTC)
Organization: Citizens Bank
Lines: 11
Message-ID: <h2vi9h$ln$1@fred.mathworks.com>
References: <h2iud6$c94$1@fred.mathworks.com> <h2j2th$bbf$1@fred.mathworks.com> <h2tdva$20o$1@fred.mathworks.com> <h2tfpe$7jn$1@fred.mathworks.com> <h2tl61$9u4$1@fred.mathworks.com>
Reply-To: "Ilya Rozenfeld" <rozeni.nospam@alum.rpi.edu>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1246973041 695 172.30.248.35 (7 Jul 2009 13:24:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 7 Jul 2009 13:24:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 918333
Xref: news.mathworks.com comp.soft-sys.matlab:553403


There is nothing wrong with using loops.  But if you like here is vectorized version

N = 50;
x = (1:N)';
exlFormula = arrayfun(@(x) ['=5*A'  num2str(x)], x, 'uni', 0);
sheet.Range(['B1:B' num2str(N)]).Value = exlFormula;

"Andy Eisenberg" <theorigamist@gmail.com> wrote in message <h2tl61$9u4$1@fred.mathworks.com>...
> Yeah, that works.  But I was hoping to avoid looping in favor of a vectorized method.  In this case, there's no point trying to work around this in MATLAB.  It's far simpler to just do this in Excel (that is what it was made for after all), and then pull the resulting data into MATLAB.
> 
> Thanks.