1
$\begingroup$

I would like to be able to use numbers in the names of some of my variables, it's simply easier to read that typing TwoPointZero.

Is this possible? Or is there an alternative to being able to define variables in a way where I can simply read a number.

Cheers

EDIT: Is there a way to include numeric like symbols and use them in the names of variables?

$\endgroup$
  • 2
    $\begingroup$ I am not sure I understand. You can use a123. The name must start with a letter, not a number. $\endgroup$ – Szabolcs Jan 27 '17 at 10:11
  • 2
    $\begingroup$ You can also use a[123] or a[2.05] as "variables" in most contexts. Use =. to clear them (not Clear). $\endgroup$ – Szabolcs Jan 27 '17 at 10:14
  • 1
    $\begingroup$ @Szabolcs As ridiculous as this sounds, I actually had no idea that regarding a123. Thanks! Although I feel slightly silly... $\endgroup$ – Q.P. Jan 27 '17 at 10:23
  • $\begingroup$ You can use p or something to sub in for the decimal point too, e.g. a2p0 $\endgroup$ – KraZug Jan 27 '17 at 10:24
  • $\begingroup$ @Szabolcs Is it possible to use decimal numbers as a variable name e.g. 0.1pFdata = Import[...] $\endgroup$ – Q.P. Jan 27 '17 at 10:24
7
$\begingroup$

YES.

Use Script Numbers like ScriptThree

\[ScriptThree]=4
| improve this answer | |
$\endgroup$
  • 2
    $\begingroup$ You can use \ [GothicThree] and \[DoubleStruckThree] too. $\endgroup$ – Kelly Lowder Jan 27 '17 at 14:47
  • 1
    $\begingroup$ Perfect, nice answer. $\endgroup$ – Q.P. Jan 31 '17 at 20:02

Not the answer you're looking for? Browse other questions tagged or ask your own question.