MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

How to use only part of mapping


Hi,

I want to do some mapping (/@) related operations since I don't want to use 
for/while loops because of all the index mayhem.

The problem is that I don't need the map operation to continue once some 
condition is met.

Is there a way to stop the mapping operation so it will not continue, thus 
saving valuable calculation time (since there is no need to continue).

for example (not useful though)

Print[#]&/@Range[10]
and stop printing if #>5


If it isn't possible to do it with map, what are my other options?

Thanks,

Guy 



  • Prev by Date: Re: How to Clear y'[0]
  • Next by Date: Re: how to map function with over 1 arguments to list
  • Previous by thread: Re: Re: Bode Plots in Mathematica
  • Next by thread: Re: How to use only part of mapping