macro creating n Arrays within a "for"-loop

Posted by Johannes-P. Koch on
URL: http://imagej.273.s1.nabble.com/macro-creating-n-Arrays-within-a-for-loop-tp3688201.html

Dear Listers,

I am trying to create a number of arrays from within a "for"-loop. The
problem is, that the actual number of arrays depends on something else,
which means it is not known a priori. And the arrays should be called
after the loop is finished. So, just to create an array and use it within
the loop, does not work for me. The best would be to name it, let's say as
"test" and then add a number for each new array created, test 1, test 2,
...
However, the following did not seem to work....as it seems to redefine the
string "name"....

for (i=0; i<n; i++) {

     name = "test " +i;
     name = newArray(k);

}

and this is not accepted anyway...



for (i=0; i<n; i++) {

     "test " +i = newArray(k);

}


Any ideas or workarounds?

Thanks a lot, every help is very much appreciated.

Johannes