This question already has an answer here:
- Table of Variables 3 answers
Let's say I have several variables, named
I wanted to have a function
function[numberOfR_] and I wanted to have the output of the function to be
R1 if the entered
numberOfR = 1,
R2 if the entered
numberOfR = 2, etc. I tried defining this function as follows
function[numberOfR_] = "R" + numberOfR_;
but it doesn't put the
R and the number together as I hoped; instead, it just gives me
3+R' or '2+R'
not as a single variable name like
R2. What can I do to solve this?