setting up multiple arrays using sequential name.
Posted by grimper on Feb 06, 2009; 9:14am
URL: http://imagej.273.s1.nabble.com/setting-up-multiple-arrays-using-sequential-name-tp3693809.html
Hello,
I am trying to write a macro to analysis multiple image stacks. For each stack, the analyzed result would put into an array respectively. As I have n stacks, I would need to define n arrays.
Ex:
a1 = newArray(nSlices);
a2 = newArray(nSlices);
.
.
.
.
an = newArray(nSlices);
Could I use "for loop" to do this job? Like:
for (i=1; i<nImages;i++){
"a"+i = newArray(nSlices);
}
I tried this but it seems to me that by concatenating a string and a variable couldn't be assigned as the name of array.
Thanks a lot,