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


Groups > comp.soft-sys.math.mathematica > #2214 > unrolled thread

how to apply Position repeatedly without a loop?

Started bysteveh44 <steve_h44@yahoo.com>
First post2011-05-07 10:21 +0000
Last post2011-05-07 10:21 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  how to apply Position repeatedly without a loop? steveh44 <steve_h44@yahoo.com> - 2011-05-07 10:21 +0000

#2214 — how to apply Position repeatedly without a loop?

Fromsteveh44 <steve_h44@yahoo.com>
Date2011-05-07 10:21 +0000
Subjecthow to apply Position repeatedly without a loop?
Message-ID<iq36f5$dru$1@smc.vnet.net>
i have matrix A and wanted to find the Positions in this matrix of
some elements which listed in some another vector.

how to use Position to do it without a loop?

I tried this:

In[192]:= A={{1,2,3},
{3,4,5},
{6,7,8}};
elements={3,6};

Position[A,r[[1]]]
Out[194]= {{1,1}}

Position[A,r[[2]]]
Out[197]= {{1,2}}

but I want to do something like

Position[A,r]
but this does not work.

I tried Map, Thread, etc.. but could not get it to work. not sure what
the syntax is.

thanks for help
steve


[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web