Max[Min[#,b],a]&
- To: mathgroup at smc.vnet.net
- Subject: [mg35746] Max[Min[#,b],a]&
- From: Selwyn Hollis <slhollis at earthlink.net>
- Date: Sun, 28 Jul 2002 03:32:47 -0400 (EDT)
- References: <ahtugt$qnb$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Since Mathgroup had so much fun with the recent problem of counting occurences of ...,1,0,... in a list of zeros and ones, I thought I'd try to bring the collective intelligence to bear on the following: Given a matrix M of real numbers and a pair of real numbers a and b, what is the most efficient way to achieve the effect of applying the function Max[Min[#,b],a]& to each number in M? ---- Selwyn Hollis slhollis at mac.com