Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1996

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

Search the Archive

Re: Problem with If[] and %

  • To: mathgroup at
  • Subject: [mg5411] Re: Problem with If[] and %
  • From: rhall2 at (hall robert)
  • Date: Sat, 7 Dec 1996 00:25:37 -0500
  • Organization: University of Maryland, Baltimore County
  • Sender: owner-wri-mathgroup at

In article <57tl9h$rjm at>,
Hans Steffani <hans.steffani at> wrote:
>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  |  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 %