Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1996
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*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 smc.vnet.net
  • Subject: [mg5411] Re: Problem with If[] and %
  • From: rhall2 at umbc.edu (hall robert)
  • Date: Sat, 7 Dec 1996 00:25:37 -0500
  • Organization: University of Maryland, Baltimore County
  • Sender: owner-wri-mathgroup at wolfram.com

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 %