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

Home » Public Forums » archive » Identifying the index of a repeated element in an array
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Identifying the index of a repeated element in an array [message #94520] Tue, 20 June 2017 13:49 Go to previous message
thtran296 is currently offline  thtran296
Messages: 8
Registered: June 2017
Junior Member
Hello everybody,

I have an array that looks like this:
x = [1,2,3,4,5,0,1,2,0,0,0,0,1,2,3,0,0,0,1,2,3]
I am interested in the location of the element "5" (index 4), "3" (index 14), and "3" (index 20).
I am writing a program to output the above three indices.
However, using min(where(x eq 3)) keeps giving me the index of the first 3, which I do not want.
I need the index of the second 3, and the third 3.

Is there any way to do this?

Thank you so much!
[Message index]
 
Read Message
Read Message
Previous Topic: Re: Principle Componets Analysis
Next Topic: IDL client for Redis database

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

Current Time: Wed Oct 08 15:37:25 PDT 2025

Total time taken to generate the page: 0.00407 seconds