MathGroup Archive 1999

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

Search the Archive

Re: problem with Part function

  • To: mathgroup at smc.vnet.net
  • Subject: [mg18208] Re: problem with Part function
  • From: "Neal E. Tornberg" <neal.e.tornberg at boeing.com>
  • Date: Tue, 22 Jun 1999 20:41:07 -0400
  • Organization: Boeing
  • References: <7kho9q$qop@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

You need a sequence for your Part function
Try
mat[[##&@@xy]]=1

## is SlotSequence[1]
& turns it into a pure function
@@ applies it to the list xy

Casubolo Dario wrote:
> 
> Just a little problem:
> I've a matrix of zeros, say:
> mat=Table[Table[0,{5}],{5}];
> then, I've a point in xy axys,
> xy={3,3};
> now, I want the position {3,3} of matrix becomes 1;
> if I write
> mat[[xy]]=1; or mat[[{3,3}]]=1; it doesn't work; only mat[[3,3]]=1
> works, but I don't want rewrite all.
> I think I've to use something like Map, Thread, Apply or so, but I don't
> know what and how exactely;
> please, someone help me.
> THANK YOU
> 
> Dario Casubolo
> email: bubbola at workline.it

-- 
Neal E. Tornberg
neal.e.tornberg at boeing.com

Nobody here thinks I speak for Boeing.
You shouldn't either.



  • Prev by Date: Canceling square roots with Simplify
  • Next by Date: Re: Function definition
  • Previous by thread: Re: problem with Part function
  • Next by thread: Plotting discontinuous lines