Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: create excel plot with MATLAB?
Date: Fri, 13 Jul 2012 04:41:36 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 30
Message-ID: <jto8u0$r3j$1@newscl01ah.mathworks.com>
References: <i1njgq$1og$1@fred.mathworks.com> <i1nncr$dts$1@fred.mathworks.com> <i1noc8$hsd$1@fred.mathworks.com> <i1npis$6dt$1@fred.mathworks.com> <jt87iv$bnd$1@newscl01ah.mathworks.com> <jtf5q3$quj$1@newscl01ah.mathworks.com> <jtkdd8$kpt$1@newscl01ah.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: www-04-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1342154496 27763 172.30.248.35 (13 Jul 2012 04:41:36 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 13 Jul 2012 04:41:36 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 3536503
Xref: news.mathworks.com comp.soft-sys.matlab:773899

Okay, I tried this but it gave an error message:

x=(0:2:100)';
y=sin(x);
eS.Range('A1:K50').Value = [x y];

%%

eCO = eS.ChartObjects.Add(100, 30, 400, 250);
eC = eCO.Chart;
for ii = 1:10
eC.SeriesCollection.NewSeries;
% better control of the data if the line number
% is not your x-axis
%eC.SeriesCollection(ii).Value = eS.Range('[[[char(ExcelCol(ii+1)) '1'] ':'] char(ExcelCol(3+1)) '50']');
%eC.SeriesCollection(1).Value = eS.Range('B1:B50');
eC.SeriesCollection(ii).Value = eS.Range('B1:K50');
eC.SeriesCollection(1).XValue = eS.Range('A1:A50');
end

>> ExcelMat

Error: Object returned error code: 0x800A03EC

Error in ExcelMat (line 25)
eC.SeriesCollection(ii).Value = eS.Range('B1:K50');

The EXCEL file only has numbers in columns B1:B50. Columns C1:C50 have "N/A" in them.

Any suggestions?