Re: [Mathematica] special iterator
- To: mathgroup at smc.vnet.net
- Subject: [mg120606] Re: [Mathematica] special iterator
- From: Heike Gramberg <heike.gramberg at gmail.com>
- Date: Sat, 30 Jul 2011 07:19:49 -0400 (EDT)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- References: <201107300958.FAA25264@smc.vnet.net>
With a number of functions such as Do and Table, you can specify the
iteration range in the form {i, {i1,i2,=85}}, so
to iterate over all indices except j you could do something like
Do[ <something>, {i, Drop[Range[Length[myList]], {j}]}
Heike
On 30 Jul 2011, at 10:58, lorenzo wrote:
> Hello everybody,
>
> I would like to define an iterator to explore all the elements in a
list except for the one of index j.
>
> something like:
> {index,0,Length[myList]} and if index == j ---> index++
>
> Is it possible?
> Can I do this without deleting the j-th element?
>
> Thank you very much for helping :)
>
- References:
- [Mathematica] special iterator
- From: lorenzo <lorenzo_ktm@yahoo.it>
- [Mathematica] special iterator