comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Compare two variables
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Compare two variables [message #61283 is a reply to message #61281] Sat, 12 July 2008 12:54 Go to previous messageGo to previous message
Sven Geier is currently offline  Sven Geier
Messages: 17
Registered: July 2002
Junior Member
d.poreh@gmail.com wrote:

> Hi everyone
> I have got a problem and I don?t know how to solve it:
> I have two variables like this:
> A, which col*row=2*4
> B, which col*row=4*100.
> All A?s couples (x,y)?s are somewhere in the 2th and 3th column of
> Result. I want to take this rows (I want to extract that rows in
> result which 2th and 3th columns are settled in the B?s ).for
> example:
> A=[[1,2], [3,4] ,[5,6], [7,8]]
>
> B=[?.[11,22,1,2,],?.. [44,55,3,4]?.. ,[22,99,5,6], ?.[77,66,7,8]?]
>
> ?..=means there are some other data
> I just want to extract these rows and put them in a new variable
> Any help?
> Cheers

I'm probably just misunderstanding something, but what is wrong with

line_1_index = where (b[2,*] eq a[0,0] and b[3,*] eq a[1,0])
line_2_index = ....
...

result = [b[*,line_1_index],b[*,line_2_index],b[... ],... ]

It's not terribly elegant but if it's only 5 lines and has to be typed only
once, what's the point of optimizing the hell out of it?



--
http://www.sgeier.net
My real email address does not contain any "Z"s.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: number problem
Next Topic: EARN MONEY $2500-10000 PER WEEK

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 14:52:50 PDT 2025

Total time taken to generate the page: 1.51976 seconds