Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Writing numbers as text to Excel from Matlab
Date: Thu, 8 Oct 2009 17:23:03 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 10
Message-ID: <hal75n$r6$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1255022583 870 172.30.248.38 (8 Oct 2009 17:23:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 8 Oct 2009 17:23:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1560446
Xref: news.mathworks.com comp.soft-sys.matlab:576009


Hi,

I have a cell array containing text and numbers. Among the numbers, some have decimals and others don't. To keep things simple, I have all the numbers as text and I am trying to send this cell array to an Excel file. XLSWRITE converts all the '1.0' data to '1'. Having looked around, I thought PutCellValue (by Michael Robbins) would do it:

  sheet1=Excel.Worksheets.get('Item', 'Sheet1'); 
  range=get(sheet1,'Range', 'A1');
  PutCellValue(range,'1.0',1);

but I still get the value of 1 on the Excel Sheet. Any ideas?
Thanks