Path: news.mathworks.com!newsfeed-00.mathworks.com!nlpi057.nbdc.sbc.com!prodigy.net!news.glorb.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!newsfe10.iad.POSTED!7564ea0f!not-for-mail
From: Walter Roberson <roberson@hushmail.com>
Organization: Canada Eat The Cookie Foundation
User-Agent: Thunderbird 2.0.0.17 (Windows/20080914)
MIME-Version: 1.0
Newsgroups: comp.soft-sys.matlab
Subject: Re: Writing variable name and value from matlab workspace
References: <gbsh1c$luc$1@fred.mathworks.com>
In-Reply-To: <gbsh1c$luc$1@fred.mathworks.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 16
Message-ID: <%tqEk.2561$i84.1493@newsfe10.iad>
NNTP-Posting-Host: 24.79.146.116
X-Complaints-To: internet.abuse@sjrb.ca
X-Trace: newsfe10.iad 1222783995 24.79.146.116 (Tue, 30 Sep 2008 14:13:15 UTC)
NNTP-Posting-Date: Tue, 30 Sep 2008 14:13:15 UTC
Date: Tue, 30 Sep 2008 09:13:38 -0500
Xref: news.mathworks.com comp.soft-sys.matlab:492939


SURESH wrote:

> In brief, is it possible to write the variable name and its value from the 
> matlab workspace to an excel file. I know that using &#8220;xlswrite&#8221;
> command, we can write the values from the workspace to an excel file. But I
> would like to know whether I can write the variable name as well.

Only by converting the name into a value and writing it along with the other
values.

If you are using xlswrite() under MS Windows you can (I gather)
write fairly sophisticated files, but under any of the other operating systems
-effectively- in order to write a string as part of the data, you have to
convert *everything* to text before-hand, including putting in all
of the cell delimeters as part of the created text, and write out the text using
dlmwrite() with the cell delimeter set to the empty string.