MathGroup Archive 2009

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

Search the Archive

Re: Show doesn't work inside Do loop ?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg101923] Re: Show doesn't work inside Do loop ?
  • From: Peter Breitfeld <phbrf at t-online.de>
  • Date: Thu, 23 Jul 2009 03:54:59 -0400 (EDT)
  • References: <h46p3c$e4k$1@smc.vnet.net>

"ibmichuco at hotmail.com" wrote:

> Hi,
>
> Is there a way to use Show inside a Do loop? For example, the
> following doesn't work:
>
> Do[
>  Print["i =",i];
>  Fig = Plot[Sin[i*x], {x, -5, 5}];
>  Show[Fig]
>  , {i, 1, 5}]
>
> I would like to print different info at each step of the loop,
> therefore saving all Fig in a Table or Array doesn't help me.
>
> Thanks,
>
> Michuco
>

Everything you want to be displayed in a Do loop has to be inside of
Print. So use Print[Fig] of (not necessary in this case) Print[Show[Fig]].

-- 
_________________________________________________________________
Peter Breitfeld, Bad Saulgau, Germany -- http://www.pBreitfeld.de


  • Prev by Date: Re: Show doesn't work inside Do loop ?
  • Next by Date: Re: Show doesn't work inside Do loop ?
  • Previous by thread: Re: Show doesn't work inside Do loop ?
  • Next by thread: Re: Show doesn't work inside Do loop ?