Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Automating variable naming
Date: Thu, 11 Dec 2008 19:52:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 8
Message-ID: <ghrr11$2tp$1@fred.mathworks.com>
References: <ghrppm$6ua$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1229025122 3001 172.30.248.37 (11 Dec 2008 19:52:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 11 Dec 2008 19:52:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 939004
Xref: news.mathworks.com comp.soft-sys.matlab:506416


"Blair " <bgoodridge@bren.ucsb.edu> wrote in message <ghrppm$6ua$1@fred.mathworks.com>...
> I'm trying to find a method to give unique names to workspace variables without having to manually do this in the workspace.  I have a function which looks up Excel file names and puts them into a cell array.  I'd like to use those unique file names to label the variable (matrix) that the larger function outputs, so that I can just automate processing and loop through.  I'm taking Excel files, reading them and their filenames, doing slight manipulation/cleaning up, and then outputting in matlab.
> 
> I know this is a basic question, but it's frustrating that I'm unable to find the answer to this seemingly simple issue anywhere.
> 
> Thanks for the assistance!

Check out the function genvarname. Though I'm afraid to actually use the names it comes up with you'll have to use eval.