MathGroup Archive 2007

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

Search the Archive

Re: Easy Mapping problem that has me stumped!

  • To: mathgroup at smc.vnet.net
  • Subject: [mg82787] Re: Easy Mapping problem that has me stumped!
  • From: Szabolcs Horvát <szhorvat at gmail.com>
  • Date: Wed, 31 Oct 2007 06:07:02 -0500 (EST)
  • References: <fg6qur$dqp$1@smc.vnet.net>

RicoS wrote:
> I'm trying to iterate through a list and add x to different elements, got that. But I want to keep the values <= 1.
> I have something like this:
> 
> m = {{{0, 1, 1}, {1, 0, 1}, {1, 1, 0}}, {{1, 0, 0}, {0,1,0}, {0,0,1}}}
> 
> Manipulate[Map[# + ({x, y, z}) &, m, {2}], {x, 0, 1}, {y, 0, 1}, {z, 0, 1}]
> 
> That works great. But I want to keep x,y & z <=1. (It'a a threshold thing)
> 
> How should I apply Min? I've tried everything I can think of, but I'm a total noob.
> Thanks for your help!!
> 

But they are <= 1, since you used the range {0, 1} for all three of them!

Or do you mean this? --

Manipulate[
  Clip@Map[# + ({x, y, z}) &, m, {2}], {x, 0, 1}, {y, 0, 1}, {z, 0, 1}]

-- 
Szabolcs


  • Prev by Date: NumberPadding on the left
  • Next by Date: Re: "Accumulate" in Mathematica 6
  • Previous by thread: Re: Easy Mapping problem that has me stumped!
  • Next by thread: Re: Easy Mapping problem that has me stumped!