Re: How to find the Max of a Piecewise function
- To: mathgroup at smc.vnet.net
- Subject: [mg90427] Re: How to find the Max of a Piecewise function
- From: "David Park" <djmpark at comcast.net>
- Date: Wed, 9 Jul 2008 04:53:00 -0400 (EDT)
- References: <g4vk81$9pv$1@smc.vnet.net>
Why do you write a doubly nested expression, not obtain the result you expect, and then fail to look at what the intermediate results are? Either give f the Listable Attribute, or Map f onto the list generated by Range. As defined by you f does not work with a List as an argument -- David Park djmpark at comcast.net http://home.comcast.net/~djmpark/ "Aaron Fude" <aaronfude at gmail.com> wrote in message news:g4vk81$9pv$1 at smc.vnet.net... > 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 >