Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2008

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

Search the Archive

Re: How to find the Max of a Piecewise function

  • To: mathgroup at smc.vnet.net
  • Subject: [mg90441] Re: How to find the Max of a Piecewise function
  • From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
  • Date: Wed, 9 Jul 2008 04:55:47 -0400 (EDT)
  • Organization: Uni Leipzig
  • References: <g4vk81$9pv$1@smc.vnet.net>
  • Reply-to: kuska at informatik.uni-leipzig.de

Hi,

f[x_?NumericQ] := Piecewise[{{1, x < 1}, {2, x > 1}}]
f[x_List] := f /@ x

or the attribute Listable for f[] may help.

Regards
   Jens

Aaron Fude wrote:
> Hi,
> 
> If f is deined according to
> 
> f[x_] := Piecewise[{{1, x < 1}, {2, x > 1}}]
> 
> then
> 
> Max[f[Range[0, 1, .001]]]
> 
> does not yield the desired result. What's the proper way to approach
> this?
> 
> Thanks!
> 
> Aaron
> 


  • Prev by Date: Re: Re: Minimum input for GroebnerBasis
  • Next by Date: Re: more inset export problems
  • Previous by thread: Re: How to find the Max of a Piecewise function
  • Next by thread: Re: Re: How to find the Max of a Piecewise function