MathGroup Archive 2004

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

Search the Archive

Re: Problems using variables in an IF command

  • To: mathgroup at smc.vnet.net
  • Subject: [mg50667] Re: Problems using variables in an IF command
  • From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
  • Date: Wed, 15 Sep 2004 07:54:49 -0400 (EDT)
  • Organization: Universitaet Leipzig
  • References: <ci8mh6$brf$1@smc.vnet.net>
  • Reply-to: kuska at informatik.uni-leipzig.de
  • Sender: owner-wri-mathgroup at wolfram.com

Hi,

and

Unprotect[Less]

Less[lst1_List, lst2_List] /; Length[lst1] == Length[lst2] := 
  And @@ (Less @@@ Transpose[{lst1, lst2}])

Protect[Less]

will do it.

Regards
  Jens



"T." wrote:
> 
> 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: Text in Tables
  • Next by Date: Re: Unevaluated
  • Previous by thread: Problems using variables in an IF command
  • Next by thread: need to call data from a list as input but need it in vector form not list form