LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
ouadji

Search for a different element

Status: Declined

Any idea that has received less than 2 kudos within 2 years after posting will be automatically declined.

a possible improvement for the "search 1D function"

 

The current function searches for an element identical to the input element.
It would be useful to be able to do the opposite :

 


            Search 1D Array : be able to search a different element

 


a new function or ...

the current function with an option to select : "the same element", or "a different element".

 

and why not (It would be also useful) an additional output with this different element.

 

 

SR1.png

14 Comments
X.
Trusted Enthusiast
Trusted Enthusiast

No problem, that was fun.

 

In retrospect, I think that most likely the ONLY use case thought for by NI was when ALL arrays have the same dimension (in which case the comparison is done element by element, as is the case with the default "Comparison Mode>>Compare Element" mode of the In Range primitive).

For instance:

 

ScreenHunter_001.jpg

 

returns a 7-element Boolean array (all True) and the index of element is thus zero.

Any discrepancy in size between the input arrays results in the minimum array size being retained for comparisons, as for most other array-based functions/primitives.

 

ouadji
Trusted Enthusiast

all understood.

 

I think that most likely the ONLY use case thought for by NI was when ALL arrays have the same dimension

 

agree with you.

 

My English is not very good. I understand rather easily reading but writing is more difficult.

My vocabulary is limited. I do my best. Smiley Frustrated


Fortunately, the code is a universal language.

It's 00.40 am here, i'm going to bed. Again, thank for all.

Manzolli
Active Participant

I know that this forum is for new ideas, but let me give a try to answer some questions:

 

1) The “In Range and Coerce” trims the input data to the smallest vector (1D array).

 

2) When a vector is an input, the function gets each correspondent is each input and do the “In Range and Coerce” processing.

 

3) A scalar is a treated like a vector with the necessary size of the scalar value.

 

4) X use case: Suppose that you have some data and you need to know if all are in range (and/or coerce). A vector of given data can be tested with two other vectors, one with upper limits, other with lower limits. For a practical use, better have vectors with the same size.

 

I apologize if I said something obvious, but I think is better be as clear as possible.

André Manzolli

Mechanical Engineer
Certified LabVIEW Developer - CLD
LabVIEW Champion
Curitiba - PR - Brazil
Darren
Proven Zealot
Status changed to: Declined

Any idea that has received less than 2 kudos within 2 years after posting will be automatically declined.