MathGroup Archive 2011

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

Search the Archive

Re: A matrix element specified by a vector?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg123357] Re: A matrix element specified by a vector?
  • From: A Retey <awnl at gmx-topmail.de>
  • Date: Sat, 3 Dec 2011 04:13:07 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <jbag3k$1v9$1@smc.vnet.net>

Hi,

>
> myMatrix[[   myVector[[1]],  myVector[[2]]   ]]  =  myScalar
>
> This keeps coming up. Did I miss the quick and easy way to do it? Of
> course it looks even uglier in 3 dimensions.

if the length of myVector matches the depth of myMatrix, this will work:

myMatrix[[Sequence@@myVector]] = myScalar

hth,

albert



  • Prev by Date: Re: A function to do incomplete LU decomposition with a drop tolerance?
  • Next by Date: Re: A matrix element specified by a vector?
  • Previous by thread: Re: A matrix element specified by a vector?
  • Next by thread: Re: A matrix element specified by a vector?