|
From: | Vergil Mueller |
Subject: | Re: string to variable? |
Date: | Mon, 4 Sep 2006 11:36:46 -0600 |
or do you wanteval(x)On Sep 4, 2006, at 7:08 PM, José Luis García Pallero wrote: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
x
My hope is that running this script would return
x = 2
Is there a way to do this?
Thanks!
--
View this message in context: http://www.nabble.com/string-to-variable--tf2216346.html#a6138647
Sent from the Octave - General forum at Nabble.com .
_______________________________________________
Help-octave mailing list
address@hidden
https://www.cae.wisc.edu/mailman/listinfo/help-octave
--
*****************************************
José Luis García Pallero
address@hidden
(o<
/ / \
V_/_
Use Debian GNU/Linux and enjoy!
*****************************************_______________________________________________Help-octave mailing list
[Prev in Thread] | Current Thread | [Next in Thread] |