Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #4072 > unrolled thread

[Mathematica] special iterator

Started bylorenzo <lorenzo_ktm@yahoo.it>
First post2011-07-30 09:59 +0000
Last post2011-07-31 11:25 +0000
Articles 2 — 2 participants

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  [Mathematica] special iterator lorenzo <lorenzo_ktm@yahoo.it> - 2011-07-30 09:59 +0000
    Re: [Mathematica] special iterator "andre.robin3" <andre.robin3@wanadoo.fr> - 2011-07-31 11:25 +0000

#4072 — [Mathematica] special iterator

Fromlorenzo <lorenzo_ktm@yahoo.it>
Date2011-07-30 09:59 +0000
Subject[Mathematica] special iterator
Message-ID<j10kmc$omh$1@smc.vnet.net>
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 :)

[toc] | [next] | [standalone]


#4093

From"andre.robin3" <andre.robin3@wanadoo.fr>
Date2011-07-31 11:25 +0000
Message-ID<j13e30$51t$1@smc.vnet.net>
In reply to#4072
If you use the iterator in a Table[...], and you can do something like this 
:

           Table[i, { f[i] , DeleteCases[Range[10], 3 | 4}]

--->   {f[1], f[2], f[5], f[6], f[7], f[8], f[9], f[10]}

mathematica 7

see the doc of Table[ ] :
"Table[exp,{i,{i1,i2,...}}] uses the successives values i1,i2,... ."

I think It doesn't work on too old versions of mathematica (<5 ? )


"lorenzo" <lorenzo_ktm@yahoo.it> a écrit dans le message de news: 
j10kmc$omh$1@smc.vnet.net...
> 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 :)
> 


[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web