Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: genvarname doesn't work
Date: Fri, 10 Jul 2009 17:38:02 +0000 (UTC)
Organization: The MathWorks Inc
Lines: 18
Message-ID: <h37u9p$fho$1@fred.mathworks.com>
References: <h37t8i$6kh$1@fred.mathworks.com>
Reply-To: <HIDDEN>
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 1247247482 15928 172.30.248.35 (10 Jul 2009 17:38:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 10 Jul 2009 17:38:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1597503
Xref: news.mathworks.com comp.soft-sys.matlab:554532


Hi Juliette, The included code runs fine for me on R2007b (Windows) and I see nothing in the bug reports. Can you give us the error message?

wayne

"Juliette Salexa" <juliette.physicist@gmail.com> wrote in message <h37t8i$6kh$1@fred.mathworks.com>...
> I have R2007b, and copied and pasted this code from the matlab documentation:
> 
> for k = 1:5
>    t = clock;
>    pause(uint8(rand * 10));
>    v = genvarname('time_elapsed', who);
>    eval([v ' = etime(clock,t)'])
>    end
> 
> and it doesn't work because genvarname('aa') gives [0 0]
> ie, for every character in the string, a new element is created in the output vector.
> 
> The code above doesn't even run without an error message.  Was this function modified in a new version of matlab or something ??