Hi,
how do i fill an array like this: for(i=0; i<10; i++){ a[i] = i; } Someone could help me plz? Since now i thank your help. -- *Ramon Costa Silva* *Graduando em Ciência da Computação.* *Voluntário: Laboratório Aprendizagem Computacional e Métodos de Otimização e Robótica - LACMOR.* *Estagiário: Núcleo de Tecnologia da Informação - NTI.* *Universidade Federal do Maranhão - UFMA.* -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
a = newArray(10);
for (i = 0; i < 10; i++) { a[i] = i; print(a[i]); } > On Mar 22, 2016, at 7:47 PM, Ramon Silva <[hidden email]> wrote: > > Hi, > > how do i fill an array like this: > > for(i=0; i<10; i++){ > a[i] = i; > } > > Someone could help me plz? > Since now i thank your help. > > -- > > *Ramon Costa Silva* > > *Graduando em Ciência da Computação.* > > *Voluntário: Laboratório Aprendizagem Computacional e Métodos de Otimização > e Robótica - LACMOR.* > > *Estagiário: Núcleo de Tecnologia da Informação - NTI.* > *Universidade Federal do Maranhão - UFMA.* > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Thanks bro!
Em 22/03/2016 23:59, "Christopher Coulon" <[hidden email]> escreveu: > a = newArray(10); > for (i = 0; i < 10; i++) { > a[i] = i; > print(a[i]); > } > > > On Mar 22, 2016, at 7:47 PM, Ramon Silva <[hidden email]> > wrote: > > > > Hi, > > > > how do i fill an array like this: > > > > for(i=0; i<10; i++){ > > a[i] = i; > > } > > > > Someone could help me plz? > > Since now i thank your help. > > > > -- > > > > *Ramon Costa Silva* > > > > *Graduando em Ciência da Computação.* > > > > *Voluntário: Laboratório Aprendizagem Computacional e Métodos de > Otimização > > e Robótica - LACMOR.* > > > > *Estagiário: Núcleo de Tecnologia da Informação - NTI.* > > *Universidade Federal do Maranhão - UFMA.* > > > > -- > > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
My pleasure! ;-)
> On Mar 22, 2016, at 8:31 PM, Ramon Silva <[hidden email]> wrote: > > Thanks bro! > Em 22/03/2016 23:59, "Christopher Coulon" <[hidden email]> > escreveu: > >> a = newArray(10); >> for (i = 0; i < 10; i++) { >> a[i] = i; >> print(a[i]); >> } >> >>> On Mar 22, 2016, at 7:47 PM, Ramon Silva <[hidden email]> >> wrote: >>> >>> Hi, >>> >>> how do i fill an array like this: >>> >>> for(i=0; i<10; i++){ >>> a[i] = i; >>> } >>> >>> Someone could help me plz? >>> Since now i thank your help. >>> >>> -- >>> >>> *Ramon Costa Silva* >>> >>> *Graduando em Ciência da Computação.* >>> >>> *Voluntário: Laboratório Aprendizagem Computacional e Métodos de >> Otimização >>> e Robótica - LACMOR.* >>> >>> *Estagiário: Núcleo de Tecnologia da Informação - NTI.* >>> *Universidade Federal do Maranhão - UFMA.* >>> >>> -- >>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html >> >> >> -- >> ImageJ mailing list: http://imagej.nih.gov/ij/list.html >> > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
You could also use:
a=Array.getSequence(10); Array.print(a); Jerome. On 23 March 2016 at 04:50, Christopher Coulon <[hidden email]> wrote: > My pleasure! ;-) > > > On Mar 22, 2016, at 8:31 PM, Ramon Silva <[hidden email]> > wrote: > > > > Thanks bro! > > Em 22/03/2016 23:59, "Christopher Coulon" <[hidden email]> > > escreveu: > > > >> a = newArray(10); > >> for (i = 0; i < 10; i++) { > >> a[i] = i; > >> print(a[i]); > >> } > >> > >>> On Mar 22, 2016, at 7:47 PM, Ramon Silva <[hidden email]> > >> wrote: > >>> > >>> Hi, > >>> > >>> how do i fill an array like this: > >>> > >>> for(i=0; i<10; i++){ > >>> a[i] = i; > >>> } > >>> > >>> Someone could help me plz? > >>> Since now i thank your help. > >>> > >>> -- > >>> > >>> *Ramon Costa Silva* > >>> > >>> *Graduando em Ciência da Computação.* > >>> > >>> *Voluntário: Laboratório Aprendizagem Computacional e Métodos de > >> Otimização > >>> e Robótica - LACMOR.* > >>> > >>> *Estagiário: Núcleo de Tecnologia da Informação - NTI.* > >>> *Universidade Federal do Maranhão - UFMA.* > >>> > >>> -- > >>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html > >> > >> > >> -- > >> ImageJ mailing list: http://imagej.nih.gov/ij/list.html > >> > > > > -- > > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > -- Jerome Mutterer CNRS - Institut de biologie moléculaire des plantes 12, rue du Général Zimmer 67084 Strasbourg Cedex www.ibmp.cnrs.fr -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Thanks Jerome!
Em 23 de março de 2016 07:54, Jerome Mutterer < [hidden email]> escreveu: > You could also use: > > a=Array.getSequence(10); > Array.print(a); > > Jerome. > > On 23 March 2016 at 04:50, Christopher Coulon < > [hidden email]> > wrote: > > > My pleasure! ;-) > > > > > On Mar 22, 2016, at 8:31 PM, Ramon Silva <[hidden email]> > > wrote: > > > > > > Thanks bro! > > > Em 22/03/2016 23:59, "Christopher Coulon" < > [hidden email]> > > > escreveu: > > > > > >> a = newArray(10); > > >> for (i = 0; i < 10; i++) { > > >> a[i] = i; > > >> print(a[i]); > > >> } > > >> > > >>> On Mar 22, 2016, at 7:47 PM, Ramon Silva <[hidden email]> > > >> wrote: > > >>> > > >>> Hi, > > >>> > > >>> how do i fill an array like this: > > >>> > > >>> for(i=0; i<10; i++){ > > >>> a[i] = i; > > >>> } > > >>> > > >>> Someone could help me plz? > > >>> Since now i thank your help. > > >>> > > >>> -- > > >>> > > >>> *Ramon Costa Silva* > > >>> > > >>> *Graduando em Ciência da Computação.* > > >>> > > >>> *Voluntário: Laboratório Aprendizagem Computacional e Métodos de > > >> Otimização > > >>> e Robótica - LACMOR.* > > >>> > > >>> *Estagiário: Núcleo de Tecnologia da Informação - NTI.* > > >>> *Universidade Federal do Maranhão - UFMA.* > > >>> > > >>> -- > > >>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html > > >> > > >> > > >> -- > > >> ImageJ mailing list: http://imagej.nih.gov/ij/list.html > > >> > > > > > > -- > > > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > > > > -- > > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > > > > > > -- > Jerome Mutterer > CNRS - Institut de biologie moléculaire des plantes > 12, rue du Général Zimmer > 67084 Strasbourg Cedex > www.ibmp.cnrs.fr > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > -- *Ramon Costa Silva* *Graduando em Ciência da Computação.* *Voluntário: Laboratório Aprendizagem Computacional e Métodos de Otimização e Robótica - LACMOR.* *Estagiário: Núcleo de Tecnologia da Informação - NTI.* *Universidade Federal do Maranhão - UFMA.* -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
In reply to this post by Jerome Mutterer-3
and for an open ended array:
a = newArray(0); for (i = 0; i < 10; i++) { a=Array.concat(a,i); Array.show(a); } Glen MacDonald Digital Microscopy Center Box 357923 University of Washington Seattle, WA 98195-7923 USA (206) 616-4156 [hidden email] > On Mar 23, 2016, at 3:54 AM, Jerome Mutterer <[hidden email]> wrote: > > You could also use: > > a=Array.getSequence(10); > Array.print(a); > > Jerome. > > On 23 March 2016 at 04:50, Christopher Coulon <[hidden email]> > wrote: > >> My pleasure! ;-) >> >>> On Mar 22, 2016, at 8:31 PM, Ramon Silva <[hidden email]> >> wrote: >>> >>> Thanks bro! >>> Em 22/03/2016 23:59, "Christopher Coulon" <[hidden email]> >>> escreveu: >>> >>>> a = newArray(10); >>>> for (i = 0; i < 10; i++) { >>>> a[i] = i; >>>> print(a[i]); >>>> } >>>> >>>>> On Mar 22, 2016, at 7:47 PM, Ramon Silva <[hidden email]> >>>> wrote: >>>>> >>>>> Hi, >>>>> >>>>> how do i fill an array like this: >>>>> >>>>> for(i=0; i<10; i++){ >>>>> a[i] = i; >>>>> } >>>>> >>>>> Someone could help me plz? >>>>> Since now i thank your help. >>>>> >>>>> -- >>>>> >>>>> *Ramon Costa Silva* >>>>> >>>>> *Graduando em Ciência da Computação.* >>>>> >>>>> *Voluntário: Laboratório Aprendizagem Computacional e Métodos de >>>> Otimização >>>>> e Robótica - LACMOR.* >>>>> >>>>> *Estagiário: Núcleo de Tecnologia da Informação - NTI.* >>>>> *Universidade Federal do Maranhão - UFMA.* >>>>> >>>>> -- >>>>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html >>>> >>>> >>>> -- >>>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html >>>> >>> >>> -- >>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html >> >> -- >> ImageJ mailing list: http://imagej.nih.gov/ij/list.html >> > > > > -- > Jerome Mutterer > CNRS - Institut de biologie moléculaire des plantes > 12, rue du Général Zimmer > 67084 Strasbourg Cedex > www.ibmp.cnrs.fr > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Thanks Glen. My problem is now solved!
2016-03-23 12:12 GMT-03:00 Glen MacDonald <[hidden email]>: > and for an open ended array: > a = newArray(0); > for (i = 0; i < 10; i++) { > a=Array.concat(a,i); > Array.show(a); > } > > Glen MacDonald > Digital Microscopy Center > Box 357923 > University of Washington > Seattle, WA 98195-7923 USA > (206) 616-4156 > [hidden email] > > > > > > > > > > On Mar 23, 2016, at 3:54 AM, Jerome Mutterer < > [hidden email]> wrote: > > > > You could also use: > > > > a=Array.getSequence(10); > > Array.print(a); > > > > Jerome. > > > > On 23 March 2016 at 04:50, Christopher Coulon < > [hidden email]> > > wrote: > > > >> My pleasure! ;-) > >> > >>> On Mar 22, 2016, at 8:31 PM, Ramon Silva <[hidden email]> > >> wrote: > >>> > >>> Thanks bro! > >>> Em 22/03/2016 23:59, "Christopher Coulon" < > [hidden email]> > >>> escreveu: > >>> > >>>> a = newArray(10); > >>>> for (i = 0; i < 10; i++) { > >>>> a[i] = i; > >>>> print(a[i]); > >>>> } > >>>> > >>>>> On Mar 22, 2016, at 7:47 PM, Ramon Silva <[hidden email]> > >>>> wrote: > >>>>> > >>>>> Hi, > >>>>> > >>>>> how do i fill an array like this: > >>>>> > >>>>> for(i=0; i<10; i++){ > >>>>> a[i] = i; > >>>>> } > >>>>> > >>>>> Someone could help me plz? > >>>>> Since now i thank your help. > >>>>> > >>>>> -- > >>>>> > >>>>> *Ramon Costa Silva* > >>>>> > >>>>> *Graduando em Ciência da Computação.* > >>>>> > >>>>> *Voluntário: Laboratório Aprendizagem Computacional e Métodos de > >>>> Otimização > >>>>> e Robótica - LACMOR.* > >>>>> > >>>>> *Estagiário: Núcleo de Tecnologia da Informação - NTI.* > >>>>> *Universidade Federal do Maranhão - UFMA.* > >>>>> > >>>>> -- > >>>>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html > >>>> > >>>> > >>>> -- > >>>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html > >>>> > >>> > >>> -- > >>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html > >> > >> -- > >> ImageJ mailing list: http://imagej.nih.gov/ij/list.html > >> > > > > > > > > -- > > Jerome Mutterer > > CNRS - Institut de biologie moléculaire des plantes > > 12, rue du Général Zimmer > > 67084 Strasbourg Cedex > > www.ibmp.cnrs.fr > > > > -- > > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > -- *Ramon Costa Silva* *Graduando em Ciência da Computação.* *Voluntário: Laboratório Aprendizagem Computacional e Métodos de Otimização e Robótica - LACMOR.* *Estagiário: Núcleo de Tecnologia da Informação - NTI.* *Universidade Federal do Maranhão - UFMA.* -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Free forum by Nabble | Edit this page |