Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #6908

Re: A matrix element specified by a vector?

From A Retey <awnl@gmx-topmail.de>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: A matrix element specified by a vector?
Date 2011-12-03 09:14 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jbcpag$biq$1@smc.vnet.net> (permalink)
References <jbag3k$1v9$1@smc.vnet.net>

Show all headers | View raw


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

Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

A matrix element specified by a vector? Ralph Dratman <ralph.dratman@gmail.com> - 2011-12-02 12:25 +0000
  Re: A matrix element specified by a vector? A Retey <awnl@gmx-topmail.de> - 2011-12-03 09:14 +0000
  Re: A matrix element specified by a vector? "Oleksandr Rasputinov" <oleksandr_rasputinov@hmamail.com> - 2011-12-03 10:12 +0000

csiph-web