0

I'm trying to append filenames with Mathematica, and cannot do it. The output of my calculation are two lists : X and Y, calculated for a varying parameter G.

So I want to have X0, Y0 for G = 0, X0.5, Y0.5 for G = 0.5, etc. In python, I would just automate this by defining X"$G", Y"$G", and do a loop on G.

Is there an equivalent in Mathematica?

m_goldberg
  • 107,779
  • 16
  • 103
  • 257
Edouard
  • 71
  • 4

1 Answers1

2

Not sure exactly what you are looking for, but you can deal with strings quite nicely in Mathematica. For instance, say you have x="this" and y="that" and you want to write ten files that are numbered consectutively. You might create

 fileNames=Table[StringJoin[x, y, ToString[i]], {i, 1, 10}]

which gives you a list of 10 file names. Of course you can build the names up any way you wish.

bill s
  • 68,936
  • 4
  • 101
  • 191