From: Bruno Luong on
"John " <wwwinfor(a)gmail.com> wrote in message <hme37m$3l0$1(a)fred.mathworks.com>...
> how to get the name of a variable and assign it as a string to a new variable?
>
> Thanks!

getname=@(varargin) inputname(1);

a = pi;
myname = getname(a)

% Bruno