Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*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 2004

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

Search the Archive

Problems using variables in an IF command

  • To: mathgroup at smc.vnet.net
  • Subject: [mg50642] Problems using variables in an IF command
  • From: monster_economist at punkass.com (T.)
  • Date: Wed, 15 Sep 2004 01:49:57 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

What about this one.  "C" is just some list and "avgvol" and "stddev"
are just some variables I computed.  When I do this,

If[N[(c[[j + 1]] - c[[j]])/c[[j]] ] < avgvol + stddev*2, z = 0, z = 1]

I get this output

If[{0.07551} < {0.168262}, z = 0, z = 1]

I need to get rid of those {} brackets so that the IF command will
work and spit out z=0 or z=1, which I plan to use later on.  Any
suggestions.


  • Prev by Date: how do I display "Power[z,-1]" in an exponetial form?
  • Next by Date: need to call data from a list as input but need it in vector form not list form
  • Previous by thread: Re: how do I display "Power[z,-1]" in an exponetial form?
  • Next by thread: Re: Problems using variables in an IF command