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$
9
  • 2
    $\begingroup$ I am not sure I understand. You can use a123. The name must start with a letter, not a number. $\endgroup$
    – Szabolcs
    Commented Jan 27, 2017 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
    Commented Jan 27, 2017 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$
    – user27119
    Commented Jan 27, 2017 at 10:23
  • $\begingroup$ You can use p or something to sub in for the decimal point too, e.g. a2p0 $\endgroup$
    – SPPearce
    Commented Jan 27, 2017 at 10:24
  • $\begingroup$ @Szabolcs Is it possible to use decimal numbers as a variable name e.g. 0.1pFdata = Import[...] $\endgroup$
    – user27119
    Commented Jan 27, 2017 at 10:24

1 Answer 1

7
$\begingroup$

YES.

Use Script Numbers like ScriptThree

\[ScriptThree]=4
$\endgroup$
2
  • 2
    $\begingroup$ You can use \ [GothicThree] and \[DoubleStruckThree] too. $\endgroup$ Commented Jan 27, 2017 at 14:47
  • 1
    $\begingroup$ Perfect, nice answer. $\endgroup$
    – user27119
    Commented Jan 31, 2017 at 20:02

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