[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: string to variable?

From: José Luis García Pallero
Subject: Re: string to variable?
Date: Mon, 4 Sep 2006 10:08:01 -0700

thing_a = 2;
x = sprintf('%d[or %f, etc.]',thing_a);

2006/9/4, the_verge <address@hidden>:

I was wondering if there is a way to assign a value to a variable, and then
construct a string with the same characters as the variable, and then use it
to access the value of the original variable.  For Example:

thing_a = 2;

x = "thing_a";
%code here to merge the string "thing_a" with the variable thing_a

My hope is that running this script would return

x = 2

Is there a way to do this?

View this message in context:
Sent from the Octave - General forum at

Help-octave mailing list

José Luis García Pallero
/ / \
Use Debian GNU/Linux and enjoy!
reply via email to

[Prev in Thread] Current Thread [Next in Thread]