Re: Creating multiple Arrays with for buckle

Posted by William Nicolas on
URL: http://imagej.273.s1.nabble.com/Creating-multiple-Arrays-with-for-buckle-tp5011602p5011652.html

Thanks a lot Wayne, I find your use of the getTime function interesting. I found another way around during the gap period between my question and your answer but I will keep in mind your code.

Thanks !

Regards,

William

> Le 16 févr. 2015 à 06:00, IMAGEJ automatic digest system <[hidden email]> a écrit :
>
> Date:    Mon, 16 Feb 2015 03:04:42 +0000
> From:    "Rasband, Wayne (NIH/NIMH) [E]" <[hidden email] <mailto:[hidden email]>>
> Subject: Re: Creating multiple Arrays with for buckle
>
> On Feb 15, 2015, at 3:34 PM, William Nicolas <[hidden email] <mailto:[hidden email]>> wrote:
>>
>> Hello everyone,
>>
>> I am actually working on a macro for fluorescence intensity quantifier, and I would like my macro to create for each image a new Array with serial names. i.e I want to analyze two images, thus I want 2 arrays for saving the intensity levels named something like ArrayImage1, ArrayImage2. I was thinking of doing this with a for buckle but I don’t know how to increment the name of the Arrays.
>
> There isn’t a way to create multiple arrays named array1, array2, … arrayn, where n is a variable, but you can easily create a Results table with n columns. Here is an example:
>
>  n = getTime()%10 + 1;
>  run("Clear Results");
>  for (i=1; i<=n; i++) {
>     for (j=0; j<10; j++)
>        setResult("Image"+i, j, random());
>  }
>
> -wayne


--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html