MathGroup Archive 1996

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

Search the Archive

Re: Problem with If[] and %


In article <57tl9h$rjm at dragonfly.wolfram.com>,
Hans Steffani <hans.steffani at e-technik.tu-chemnitz.de> wrote:
>
>i^2+v^2
>If[ % >15,15,%]
>Plot3D[ %,{i,-5,5},{v,-5,5}]
>
>Which only leads to several errors.

Your original code created an infinite loop. Try

   Trace[Plot3D[ %,{i,-5,5},{v,-5,5}]]

and you can see the same operation being performed over
and over again.

>What do I have to do?

   exp = i^2+v^2
   If[ exp >15,15,exp]
   Plot3D[ %,{i,-5,5},{v,-5,5}]

-- 
Bob Hall            | "Know thyself? Absurd direction!
rhall2 at gl.umbc.edu  |  Bubbles bear no introspection."  -Khushhal Khan Khatak


  • Prev by Date: init.m question
  • Next by Date: Problem with 2D Fourier-Transform
  • Previous by thread: Re: Problem with If[] and %
  • Next by thread: Re: Problem with If[] and %